本文整理汇总了PHP中FormItem::icheckbox方法的典型用法代码示例。如果您正苦于以下问题:PHP FormItem::icheckbox方法的具体用法?PHP FormItem::icheckbox怎么用?PHP FormItem::icheckbox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormItem
的用法示例。
在下文中一共展示了FormItem::icheckbox方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<?php
\Admin::model('App\\Product')->title('Products')->alias('products')->display(function () {
$display = AdminDisplay::datatablesAsync();
$display->columns([Column::checkbox(), Column::string('id')->label('#'), Column::string('title')->label('Загаловок'), Column::string('active_status')->label('Статус'), Column::string('publish')->label('Опубликован')]);
return $display;
})->createAndEdit(function () {
$form = AdminForm::tabbed();
$form->items(['Main' => [FormItem::columns()->columns([[FormItem::text('title', 'Загаловок')->required()->unique(), FormItem::textarea('description', 'Описание')->required(), FormItem::timestamp('publish', 'Дата и время публикации')->defaultValue(Carbon\Carbon::now()), FormItem::icheckbox('active', 'Статус')->defaultValue(true), FormItem::text('rest', 'Остаток'), FormItem::text('price', 'Цена')], [FormItem::text('sort', 'сортировка'), FormItem::bsselect('user_id', 'Пользователь')->model('App\\User')->defaultValue(Sentinel::check()->id)->display('email'), FormItem::bsselect('catalog_id', 'Категоря')->model('App\\Catalog')->display('level_label')->disableSort()->required()]])], 'content' => [FormItem::markdown('content', 'Контент')], 'images' => [FormItem::images('gallery', 'Картинки')], 'files' => [FormItem::view('suroviy.soa_addon::admin.elfinder')]]);
return $form;
});
示例2:
<?php
\Admin::model('App\\Category')->title('Category')->alias('category')->display(function () {
$display = AdminDisplay::tree();
$display->value('label|name');
return $display;
})->createAndEdit(function () {
$form = AdminForm::tabbed();
$form->items(['Main' => [FormItem::columns()->columns([[FormItem::text('label', 'Загаловок')->required()->unique(), FormItem::text('name', 'Название')->required()->unique(), FormItem::textarea('description', 'Описание'), FormItem::icheckbox('active_status', 'Статус')->defaultValue(true)], [FormItem::image('image', 'Картинка')]])], 'content' => [FormItem::markdown('content', 'Содержимое')]]);
return $form;
});
示例3: base_path
<?php
\Admin::model('App\\LandingBlocks')->title('Landing blocks')->alias('landing-blocks')->display(function () {
$display = AdminDisplay::table();
$display->apply(function ($query) {
$query->orderBy('order', 'ASC');
});
$display->columns([Column::checkbox(), Column::string('id')->label('#'), Column::string('label')->label('Загаловок'), Column::order()]);
return $display;
})->edit(function ($id) {
$form = AdminForm::tabbed();
$fields = [];
$fields['Main'] = [FormItem::columns()->columns([[FormItem::text('label', 'Загаловок')->required()->unique(), FormItem::textarea('description', 'Описание'), FormItem::text('class', 'Класс'), FormItem::icheckbox('active', 'Статус')->defaultValue(true)], [FormItem::text('name', 'Имя блока')->required(), FormItem::text('landing_id', 'Landing')]])];
$model = App\LandingBlocks::find($id);
if ($model) {
$path = base_path('App' . DIRECTORY_SEPARATOR . 'AdminLanding' . DIRECTORY_SEPARATOR . str_replace('.', DIRECTORY_SEPARATOR, $model->name) . '.php');
if (is_file($path)) {
$fields2 = (require_once $path);
$fields = array_merge($fields, $fields2);
}
}
$form->items($fields);
return $form;
})->create(function ($id) {
$form = AdminForm::tabbed();
$fields = [];
$fields['Main'] = [FormItem::columns()->columns([[FormItem::text('label', 'Загаловок')->required()->unique(), FormItem::textarea('description', 'Описание')->required(), FormItem::text('class', 'Класс'), FormItem::icheckbox('active', 'Статус')->defaultValue(true)], [FormItem::text('name', 'Имя блока')->required(), FormItem::text('landing_id', 'Landing')]])];
$form->items($fields);
return $form;
});
示例4:
<?php
\Admin::model('App\\Post')->title('Posts')->alias('posts')->display(function () {
$display = AdminDisplay::table();
$display->columns([Column::checkbox(), Column::string('id')->label('#'), Column::string('title')->label('Загаловок'), Column::string('active_status')->label('Статус'), Column::string('publish')->label('Опубликован')]);
return $display;
})->createAndEdit(function () {
$form = AdminForm::tabbed();
$form->items(['Main' => [FormItem::columns()->columns([[FormItem::text('title', 'Загаловок')->required()->unique(), FormItem::textarea('description', 'Описание')->required(), FormItem::timestamp('publish', 'Дата и время публикации')->defaultValue(Carbon\Carbon::now()), FormItem::icheckbox('active', 'Статус')->defaultValue(true)], [FormItem::text('alias', 'Алиас')->unique(), FormItem::bsselect('user_id', 'Пользователь')->model('App\\User')->defaultValue(Sentinel::check()->id)->display('email'), FormItem::bsselect('category_id', 'Категоря')->model('App\\Category')->display('level_label')->disableSort()->required(), FormItem::image('image', 'Картинка')]])], 'content' => [FormItem::markdown('content', 'Контент')]]);
return $form;
});
示例5: base_path
<?php
\Admin::model('App\\Landing')->title('Landing')->alias('landing')->display(function () {
$display = AdminDisplay::table();
$display->with('blocks');
$display->columns([Column::checkbox(), Column::string('id')->label('#'), Column::string('title')->label('Загаловок'), Column::string('active_status')->label('Статус'), Column::custom()->label('Блоки')->callback(function ($instance) {
return '<a href="/admin/landing-blocks?landing_id=' . $instance->id . '">Редактировать</a>';
})]);
return $display;
})->edit(function ($id) {
$form = AdminForm::tabbed();
$fields = [];
$fields['Main'] = [FormItem::columns()->columns([[FormItem::text('title', 'Загаловок')->required()->unique(), FormItem::textarea('description', 'Описание')->required(), FormItem::timestamp('publish', 'Дата и время публикации')->defaultValue(Carbon\Carbon::now()), FormItem::timestamp('publish_end', 'Дата и время олкончания публикация')->defaultValue(Carbon\Carbon::now()), FormItem::text('redirect', 'Редирект'), FormItem::icheckbox('active', 'Статус')->defaultValue(true)], [FormItem::text('alias', 'Алиас')->unique(), FormItem::text('name', 'Название')->required()->unique(), FormItem::image('image', 'Картинка')]])];
$model = App\Landing::find($id);
if ($model) {
$path = base_path('App/AdminLanding/' . $model->name . '.php');
if (is_file($path)) {
$fields2 = (require_once $path);
$fields = array_merge($fields, $fields2);
}
}
$form->items($fields);
return $form;
})->create(function ($id) {
$form = AdminForm::tabbed();
$fields = [];
$fields['Main'] = [FormItem::columns()->columns([[FormItem::text('title', 'Загаловок')->required()->unique(), FormItem::textarea('description', 'Описание')->required(), FormItem::timestamp('publish', 'Дата и время публикации')->defaultValue(Carbon\Carbon::now()), FormItem::timestamp('publish_end', 'Дата и время олкончания публикация')->defaultValue(Carbon\Carbon::now()), FormItem::text('redirect', 'Редирект'), FormItem::icheckbox('active', 'Статус')->defaultValue(true)], [FormItem::text('alias', 'Алиас')->unique(), FormItem::text('name', 'Название')->required()->unique(), FormItem::image('image', 'Картинка')]])];
$form->items($fields);
return $form;
});
示例6:
if ($instance->active) {
return ' <span><i class="fa fa-chevron-down" data-toggle="tooltip" title="" data-original-title="Active"></i></span>';
}
})->orderable(false)]);
return $display;
})->createAndEdit(function () {
$form = AdminForm::form();
$form->ajax_validation(true);
$form->items([FormItem::columns()->columns([[FormItem::text('lable', 'lable'), FormItem::bsselect('user_id', 'User')->model('App\\User')->display('email')->defaultValue(Sentinel::getUser()->id), FormItem::icheckbox('active')->label('Active')->skin('flat')], [FormItem::text('comment_id', 'Page ID'), FormItem::text('comment_type')]]), FormItem::ckeditor('content', 'Content')]);
return $form;
});
/**
* Sitemaps
*/
Admin::model('App\\Sitemap')->title('Sitemap')->alias('sitemaps')->display(function () {
$display = AdminDisplay::table();
$display->filters([Filter::field('loc')->title(function ($value) {
return 'URL:' . $value;
})]);
$display->columns([Column::checkbox(), Column::string('loc')->label('loc'), Column::string('lastmod')->label('lastmod'), Column::string('changefreq')->label('changefreq'), Column::string('priority')->label('priority'), Column::string('updated_at')->label('updated_at'), Column::custom()->label('in_sitemap')->callback(function ($instance) {
if ($instance->in_sitemap) {
return ' <span><i class="fa fa-chevron-down" data-toggle="tooltip" title="" data-original-title="Active"></i></span>';
}
})->orderable(false)]);
return $display;
})->createAndEdit(function () {
$form = AdminForm::form();
$form->ajax_validation(true);
$form->items([FormItem::columns()->columns([[FormItem::text('loc', 'loc')->required(), FormItem::timestamp('lastmod', 'lastmod')->required(), FormItem::select('changefreq', 'changefreq')->enum(['always', 'hourly', 'daily', 'weekly', 'monthly', 'yearly', 'never'])->required(), FormItem::text('priority', 'priority')->required(), FormItem::icheckbox('in_sitemap')->label('In sitemap')]])]);
return $form;
});