当前位置: 首页>>代码示例>>PHP>>正文


PHP FormItem::multiselect方法代码示例

本文整理汇总了PHP中FormItem::multiselect方法的典型用法代码示例。如果您正苦于以下问题:PHP FormItem::multiselect方法的具体用法?PHP FormItem::multiselect怎么用?PHP FormItem::multiselect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FormItem的用法示例。


在下文中一共展示了FormItem::multiselect方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

<?php

Admin::model('Angrydeer\\Productso\\Models\\PrsoProduct')->title('Товары')->display(function () {
    $display = AdminDisplay::datatables();
    $display->with();
    $display->filters([]);
    $display->columns([Column::string('name')->label('Товар'), Column::string('id')->label('Id'), Column::string('show')->label('Включен'), Column::string('views')->label('Просмотры'), Column::datetime('created_at')->label('Создан')->format('d.m.Y')]);
    return $display;
})->createAndEdit(function () {
    $form = AdminForm::form();
    $form->items([FormItem::text('name', 'Товар')->required(), FormItem::text('cost', 'Цена'), FormItem::text('slug', 'Ярлык (если не заполнять генерируется автоматически)'), FormItem::text('status', 'Статус'), FormItem::text('artikul', 'Артикул'), FormItem::multiselect('categories', 'Категории')->model('Angrydeer\\Productso\\Models\\PrsoCategory')->display('name'), FormItem::text('views', 'Просмотры')->readonly(), FormItem::checkbox('show', 'Включен')->defaultValue(true), FormItem::ckeditor('note', 'Аннотация'), FormItem::ckeditor('description', 'Описание'), FormItem::multiimages('photos', 'Изображения')]);
    return $form;
});
开发者ID:AngryDeer,项目名称:Productso,代码行数:13,代码来源:PrsoProduct.php

示例2:

<?php

/*
 * This is a simple example of the main features.
 * For full list see documentation.
 */
Admin::model('Crimibook\\Models\\Follow')->title('Users follows')->display(function () {
    $display = AdminDisplay::datatables();
    $display->with('users', 'userFollowsTo');
    $display->filters([Filter::related('follower_id')->model('Crimibook\\User'), Filter::related('followed_id')->model('Crimibook\\User')]);
    $display->columns([Column::string('users.name')->label('Follower Name')->append(Column::filter('follower_id')), Column::lists('userFollowsTo.name')->label('Follows To')->append(Column::filter('followed_id'))]);
    return $display;
})->createAndEdit(function () {
    $form = AdminForm::form();
    $form->items([FormItem::select('follower_id', 'Follower Name')->model('Crimibook\\User')->display('name')->required(), FormItem::multiselect('userFollowsTo', 'Follow To')->model('Crimibook\\User')->display('name')]);
    return $form;
});
开发者ID:kriminal666,项目名称:crimibook,代码行数:17,代码来源:Follow.php

示例3:

<?php

Admin::model(App\Role::class)->title('Роли')->display(function () {
    $display = AdminDisplay::datatables();
    $display->with('permits');
    $display->filters([]);
    $display->columns([Column::string('id')->label('Id'), Column::string('name')->label('Name'), Column::string('slug')->label('Slug')]);
    return $display;
})->createAndEdit(function () {
    $form = AdminForm::form();
    $form->items([FormItem::text('slug', 'Slug'), FormItem::text('name', 'Name'), FormItem::multiselect('permits', 'Права доступа')->model('App\\Permit')->display('name')]);
    return $form;
});
开发者ID:AngryGantz,项目名称:cms-cookbook,代码行数:13,代码来源:Role.php

示例4:

<?php

Admin::model('App\\MarkerGroup')->title('Группы маркеров')->display(function () {
    $display = AdminDisplay::datatables();
    $display->with('markers');
    $display->filters([]);
    $display->columns([Column::string('name')->label('Имя'), Column::string('id')->label('ID'), Column::lists('markers.name')->label('Маркеры')]);
    return $display;
})->createAndEdit(function () {
    $form = AdminForm::form();
    $form->items([FormItem::text('name', 'Имя')->required(), FormItem::checkbox('showadd', 'Показывать в форме добавления рецепта'), FormItem::image('ico', 'Иконка'), FormItem::text('metakey', 'Meta Keywords'), FormItem::text('metadesk', 'Meta Description'), FormItem::multiselect('markers', 'Маркеры')->model('App\\Marker')->display('name')]);
    return $form;
})->delete(function ($id) {
    if (in_array($id, [1, 2, 3])) {
        return null;
    } else {
        return 1;
    }
});
开发者ID:AngryGantz,项目名称:cms-cookbook,代码行数:19,代码来源:MarkerGroup.php

示例5:

<?php

Admin::model('App\\Contact2')->title('Contact')->alias('contacts2')->display(function () {
    $display = AdminDisplay::table();
    $display->with('country', 'companies');
    $display->filters([Filter::related('country_id')->model('App\\Country')]);
    $display->columns([Column::image('photo')->label('Photo'), Column::string('fullName')->label('Name'), Column::datetime('birthday')->label('Birthday')->format('d.m.Y'), Column::string('country.title')->label('Country')->append(Column::filter('country_id')), Column::lists('companies.title')->label('Companies')]);
    return $display;
})->createAndEdit(function () {
    $form = AdminForm::form();
    $form->items([FormItem::columns()->columns([[FormItem::text('firstName', 'First Name')->required(), FormItem::text('lastName', 'Last Name')->required(), FormItem::text('phone', 'Phone'), FormItem::text('address', 'Address')], [FormItem::image('photo', 'Photo'), FormItem::date('birthday', 'Birthday')->format('d.m.Y')], [FormItem::select('country_id', 'Country')->model('App\\Country')->display('title'), FormItem::multiselect('companies', 'Companies')->model('App\\Company')->display('title'), FormItem::textarea('comment', 'Comment')]])]);
    return $form;
})->delete(null);
开发者ID:ntamvl,项目名称:admin-3-demo,代码行数:13,代码来源:Contact2.php

示例6:

<?php

Admin::model('App\\User')->title('Пользователи')->display(function () {
    $display = AdminDisplay::datatables();
    $display->with();
    $display->filters([]);
    $display->columns([Column::string('first_name')->label('First_name'), Column::string('email')->label('Email')]);
    return $display;
})->createAndEdit(function () {
    $form = AdminForm::form();
    $form->items([FormItem::text('email', 'Email'), FormItem::text('password', 'Password'), FormItem::timestamp('last_login', 'Last Login')->format('d.m.Y'), FormItem::text('first_name', 'First Name'), FormItem::text('last_name', 'Last Name'), FormItem::multiselect('theroles', 'Роли')->model('App\\Role')->display('name')]);
    return $form;
});
开发者ID:KirSlb,项目名称:lara,代码行数:13,代码来源:User.php

示例7:

<?php

Admin::model('App\\Product')->title('Productos')->display(function () {
    $display = AdminDisplay::datatables();
    $display->with('colors');
    // $display->filters([
    // ]);
    $display->columns([Column::image('thumbnail')->label('Miniatura'), Column::string('title')->label('Título'), Column::lists('colors.name')]);
    return $display;
})->createAndEdit(function () {
    $form = AdminForm::tabbed();
    $form->items(['General' => [FormItem::text('title', 'Título'), FormItem::text('subtitle', 'Subtítulo'), FormItem::multiselect('colors', 'Colores')->model('App\\Color')->display('name'), FormItem::select('category_id', 'Categoria')->model('App\\Category')->display('name'), FormItem::text('tags', 'Serie')], 'Extra' => [FormItem::ckeditor('description', 'Descripcion'), FormItem::jsonField('specs', 'Especificaciones'), FormItem::ckeditor('details', 'Detalles')], 'Media' => [FormItem::image('thumbnail', 'Miniatura'), FormItem::images('images', 'Imagenes')], 'Venta' => [FormItem::text('price', 'Precio'), FormItem::text('link', 'Link a tienda nube')]]);
    return $form;
});
开发者ID:avilaj,项目名称:ocsport,代码行数:14,代码来源:Product.php


注:本文中的FormItem::multiselect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。