【发布时间】:2021-05-07 02:31:41
【问题描述】:
我正在尝试向我的发布条目表单添加一个选项卡,我有以下代码(为简单起见已删减),但它不起作用:
在 tab.my_module.php 中:
public function display($channel_id, $entry_id = '')
{
$settings = array();
$settings = array(
'custom_field' => array(
'field_id' => 'custom_field',
'field_label' => 'custom_field',
'field_type' => 'text'
)
);
return $settings;
}
在 upd.my_module.php 中:
public function install() {
ee()->layout->add_layout_tabs($this->tabs(), 'my_module');
}
public function tabs()
{
$tabs['my_module'] = array(
'custom_field'=> array(
'visible' => 'true',
'collapse' => 'false',
'htmlbuttons' => 'true',
'width' => '100%'
),
);
return $tabs;
}
但是我重新安装模块后hte选项卡没有出现,我错过了什么?
【问题讨论】: