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


PHP FormItem::hidden方法代码示例

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


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

示例1:

<?php

Admin::model('App\\Company')->title('Companies')->display(function () {
    $display = AdminDisplay::table();
    $display->columns([Column::string('title')->label('Title'), Column::string('address')->label('Address')]);
    return $display;
})->createAndEdit(function ($id) {
    $form = AdminForm::form();
    $form->items([FormItem::hidden('contact_id'), FormItem::text('title', 'Title')->required()->unique(), FormItem::text('address', 'Address'), FormItem::text('phone', 'Phone')]);
    return $form;
});
开发者ID:ntamvl,项目名称:admin-3-demo,代码行数:11,代码来源:Company.php

示例2:

/*
 * This is a simple example of the main features.
 * For full list see documentation.
 */
// Create admin model from User class with title and url alias
// Admin::model(App\User::class)
// ->title('Users')
// ->as('users-alias-name')->denyCreating(function ()
// {
// 	// Deny creating on thursday
// 	return date('w') == 4;
// })->display(function ()
// {
// 	// Describing columns for table view
// 	Column::string('name', 'Name');
// 	Column::string('email', 'Email');
// })->createAndEdit(function ()
// {
// 	// Describing elements in create and editing forms
// 				FormItem::text('name', 'Name');
// 				FormItem::text('email', 'Email');
// });
Admin::model(App\Announcement::class)->title('announcements')->display(function () {
    $display = AdminDisplay::datatables();
    $display->columns([Column::string('title')->label('Title'), Column::string('message')->label('message')]);
    return $display;
})->createAndEdit(function () {
    $form = AdminForm::form();
    $form->items([FormItem::columns()->columns([[FormItem::hidden('id'), FormItem::text('title', 'Title')->required()->unique(), FormItem::text('message', 'message')]])]);
    return $form;
});
开发者ID:xifat,项目名称:Laravel-5-Starter,代码行数:31,代码来源:User.php

示例3:

<?php

Admin::model(\App\Model\Category::class)->title('Категории Блога')->display(function () {
    $display = AdminDisplay::datatables();
    $display->with('pages');
    $display->filters([]);
    $display->columns([Column::string('title')->label('Название'), Column::count('pages.id')->label('Количество статей'), Column::action('show')->label('Label')->callback(function ($query) {
        return $query->active ? '&check;' : '-';
    })]);
    return $display;
})->createAndEdit(function () {
    $form = AdminForm::tabbed();
    $form->items(['Main' => [FormItem::hidden('user_id')->defaultValue(AdminAuth::user()->id), FormItem::text('title', 'Заголовок'), FormItem::text('slug', 'Slug - Заполняется автоматически'), FormItem::ckeditor('content', 'Content'), FormItem::textarea('descriptor', 'Краткое описание')]]);
    return $form;
});
开发者ID:peyoter,项目名称:pblog,代码行数:15,代码来源:Category.php

示例4:

<?php

Admin::model(App\Model\Page::class)->title('Страницы блога')->display(function () {
    $display = AdminDisplay::datatables();
    $display->with('category');
    $display->filters([]);
    $display->columns([Column::string('title')->label('Название'), Column::string('category.title')->label('Категория'), Column::action('show')->label('Label')->callback(function ($query) {
        return $query->active ? '&check;' : '-';
    })]);
    return $display;
})->createAndEdit(function () {
    $form = AdminForm::tabbed();
    $form->items(['Main' => [FormItem::hidden('user_id')->defaultValue(AdminAuth::user()->id), FormItem::select('category_id', 'Категория')->model(App\Model\Category::class), FormItem::text('title', 'Заголовок'), FormItem::text('slug', 'Slug - Заполняется автоматически'), FormItem::ckeditor('content', 'Content'), FormItem::textarea('descriptor', 'Краткое описание'), FormItem::checkbox('active', 'Активный')], 'Внешняя картинка' => [FormItem::image('image', 'Image')], 'Фоновая картика' => [FormItem::image('bg', 'Bg')]]);
    return $form;
});
开发者ID:peyoter,项目名称:pblog,代码行数:15,代码来源:Page.php


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