本文整理汇总了PHP中FormItem::multiSelect方法的典型用法代码示例。如果您正苦于以下问题:PHP FormItem::multiSelect方法的具体用法?PHP FormItem::multiSelect怎么用?PHP FormItem::multiSelect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormItem
的用法示例。
在下文中一共展示了FormItem::multiSelect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<?php
Admin::model('\\Contact')->title('Contacts')->with('country', 'companies')->filters(function () {
ModelItem::filter('country_id')->title()->from('\\Country');
ModelItem::filter('withoutCompanies')->scope('withoutCompanies')->title('without companies');
})->columns(function () {
Column::image('photo');
Column::string('full_name', 'Name')->orderBy('lastName')->sortableDefault();
Column::date('birthday', 'Birthday')->format('medium', 'none');
Column::string('country.title', 'Country')->append(Column::filter('country_id')->value('country.id'));
Column::lists('companies.title', 'Companies');
Column::action('show', 'Custom action')->target('_blank')->icon('fa-globe')->style('long')->callback(function ($instance) {
echo 'You are trying to call custom action "show" with row id "' . $instance->id . '"';
die;
});
})->form(function () {
FormItem::text('firstName', 'First Name')->required();
FormItem::text('lastName', 'Last Name')->required();
FormItem::image('photo', 'Photo');
FormItem::date('birthday', 'Birthday');
FormItem::text('phone', 'Phone');
FormItem::text('address', 'Address');
FormItem::select('country_id', 'Country')->list('\\Country')->required();
FormItem::multiSelect('companies', 'Companies')->list('\\Company')->value('companies.company_id');
FormItem::ckeditor('comment', 'Comment');
FormItem::view('admin.form.comment');
});