本文整理汇总了PHP中FormItem::chosen方法的典型用法代码示例。如果您正苦于以下问题:PHP FormItem::chosen方法的具体用法?PHP FormItem::chosen怎么用?PHP FormItem::chosen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormItem
的用法示例。
在下文中一共展示了FormItem::chosen方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
return $instance->active ? '✓' : '-';
})]);
return $display;
})->create(function ($id) {
$form = AdminForm::form();
$form->ajax_validation(true);
$form->horizontal(true);
$form->label_size('col-sm-offset-4 col-sm-1');
$form->field_size('col-sm-3');
$form->items([FormItem::text('title', 'Title')->validationRules('unique:pages,title,' . $id), FormItem::text('alias', 'Alias')->validationRules('unique:pages,alias,' . $id . ',id,context,' . Request::get('context', '')), FormItem::select('context', 'Context')->enum(config('jetcms.models.context')), FormItem::bsselect('user_id', 'User')->model('App\\User')->display('email|id')->defaultValue(Sentinel::check()->id)->nullable()]);
return $form;
})->edit(function ($id) {
$model = App\Page::find($id);
$form = AdminForm::tabbed();
$form->ajax_validation(true);
$form->items(array('Main' => array(FormItem::columns()->columns([[FormItem::text('title', 'Title')->validationRules('unique:pages,title,' . $id), FormItem::text('alias', 'Alias')->validationRules('unique:pages,alias,' . $id . ',id,context,' . Request::get('context', '')), FormItem::textarea('description', 'Description'), FormItem::chosen('tag', 'Tag')->model('App\\Tag')->display('lable')->multi(true)->nullable(), FormItem::icheckbox('active')->label('Active')->skin('flat')], [FormItem::bsselect('menu_id', 'Menu id')->options(App\Menu::getNestedList('level_lable'))->disableSort()->nullable(), FormItem::select('context', 'Context')->enum(config('jetcms.models.context')), FormItem::select('template', 'Template')->enum(config('jetcms.models.template.' . $model->context, []))->nullable()->disableSort(), FormItem::select('policies', 'Policies')->enum(config('jetcms.models.policies.' . $model->context, []))->nullable()->disableSort(), FormItem::bsselect('user_id', 'User')->model('App\\User')->display('email|id')->defaultValue(Sentinel::check()->id)->nullable(), FormItem::image('image', 'Image')]]), FormItem::images('gallery', 'Gallery')), 'Content' => [FormItem::ckeditor('content', 'Text')], 'Fields' => value(function () use($id, $model) {
//if (!$model) {return array();}
return [FormItem::custom()->display(function ($instance) use($model) {
$str = null;
foreach (config('jetcms.models.fields.' . $instance->context, array()) as $val) {
$type = $val['type'];
$input = FormItem::$type('field_array.' . $val['name'] . '', $val['lable']);
$input->defaultValue($instance->field($val['name']));
$str .= $input;
}
return $str;
})->callback(function ($instance) {
$instance->fieldArray = Request::input('field_array');
})];
}), 'Action' => [FormItem::custom()->display(function ($instance) {
$str = null;