【发布时间】:2016-04-14 14:28:51
【问题描述】:
我想在静态页面插件的菜单表单中添加自定义字段“缩略图”。
我已经将此字段添加到 project/plugins/rainlab/pages/classes/menuitem/fields.yaml 中
# ===================================
# Field Definitions
# ===================================
fields:
title:
span: left
label: rainlab.pages::lang.menuitem.title
type:
span: right
label: rainlab.pages::lang.menuitem.type
type: dropdown
url:
label: rainlab.pages::lang.menuitem.url
reference:
label: rainlab.pages::lang.menuitem.reference
type: dropdown
cssClass: input-sidebar-control
thumbnail:
label: Thumbnail
mode: file
cssClass: input-sidebar-control
type: mediafinder
// another part of code is default
同样添加到project/plugins/rainlab/pages/classes/MenuItem.php
public $thumbnail;
public $fillable = [
'title',
'nesting',
'type',
'url',
'code',
'reference',
'cmsPage',
'replace',
'viewBag',
'thumbnail' // new field
];
但它不起作用。如何解决这个问题呢?谢谢。
【问题讨论】:
标签: php laravel-5 laravel-5.1 octobercms