你可以像這個例子一樣添加多個流。
// Add banners streams
if (! $this->streams->streams->add_stream(lang('banner:banners'), 'banners', 'banner', 'banner_', null)) return false;
// Add groups streams
if (! $this->streams->streams->add_stream(lang('banner:groups'), 'groups', 'banner', 'banner_', null)) return false;
// Add some fields
$fields = array(
// BANNERS
array(
'name' => 'Banner Title',
'slug' => 'banner_title',
'namespace' => 'banner',
'assign' => 'banners',
'type' => 'text',
'extra' => array('max_length' => 200),
'title_column' => true,
'required' => true,
'unique' => true
),
// GROUPS
array(
'name' => 'Group Title',
'slug' => 'group_title',
'namespace' => 'banner',
'assign' => 'groups',
'type' => 'text',
'extra' => array('max_length' => 200),
'title_column' => true,
'required' => true,
'unique' => true
)
);
$this->streams->fields->add_fields($fields);
如果流已經存在,我只想添加一個自定義模塊作爲子菜單? – 2014-01-25 05:29:38