當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FormItem::bsselect方法代碼示例

本文整理匯總了PHP中FormItem::bsselect方法的典型用法代碼示例。如果您正苦於以下問題:PHP FormItem::bsselect方法的具體用法?PHP FormItem::bsselect怎麽用?PHP FormItem::bsselect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在FormItem的用法示例。


在下文中一共展示了FormItem::bsselect方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1:

<?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;
});
開發者ID:larabox,項目名稱:larabox,代碼行數:11,代碼來源:Post.php

示例2:

<?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;
});
開發者ID:larabox,項目名稱:larabox,代碼行數:11,代碼來源:Product.php

示例3:

Admin::model('App\\Comment')->title('Comments')->alias('comments')->display(function () {
    $display = AdminDisplay::table();
    $display->with('object', 'user');
    $display->filters([Filter::field('comment_id')->title(function ($value) {
        return 'Page ID:' . $value;
    })]);
    $display->columns([Column::checkbox(), Column::string('content')->label('content'), Column::string('user.name')->label('User'), Column::string('comment_id')->label('comment_id'), Column::custom()->label('active')->callback(function ($instance) {
        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)]);
開發者ID:jetcms,項目名稱:models,代碼行數:31,代碼來源:JetCmsModels.php


注:本文中的FormItem::bsselect方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。