本文整理汇总了PHP中FormItem类的典型用法代码示例。如果您正苦于以下问题:PHP FormItem类的具体用法?PHP FormItem怎么用?PHP FormItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FormItem类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getInstance
private static function getInstance()
{
if (empty(self::$instance)) {
self::$instance = new FormItem();
}
return self::$instance;
}
开发者ID:hugofabricio,项目名称:laravel-crud,代码行数:7,代码来源:FormItem.php
示例2: form
public function form($cb)
{
FormItem::reset();
call_user_func($cb);
$this->form = FormItem::get();
return $this;
}
开发者ID:hugofabricio,项目名称:laravel-crud,代码行数:7,代码来源:AdminItem.php
示例3: getCMSFields
function getCMSFields()
{
// Get the parent CMS fields
$oFields = parent::getCMSFields();
// Add some fields
$oFields->addFieldToTab('Root.Content.FormMessages', new HtmlEditorField('Success', 'Success Message', 3, ""));
$oFields->addFieldToTab('Root.Content.FormMessages', new HtmlEditorField('Failure', 'Failure Message', 3, ""));
//Add Rubbish Collection FormCategorys
$oCategories = new DataObjectManager($this, 'FormCategorys', 'FormCategory', array('Title' => 'Title', 'Description' => 'Description'), 'getCMSFields_forPopup');
// Set the Filter
$oFields->addFieldToTab("Root.Content.FormCategories", $oCategories);
//Add Rubbish Collection Category -> FormItems
$oItems = new DataObjectManager($this, 'FormItems', 'FormItem', array('FormCategory.Title' => 'Form Category', 'Title' => 'Title', 'Description' => 'Description'), 'getCMSFields_forPopup');
$oFields->addFieldToTab("Root.Content.FormItems", $oItems);
// Set the Filter
$oItems->setFilter('FormCategoryID', 'Filter by FormCategorys', FormItem::FormCategorySections());
//Add DataSheets
$oDataSheets = new DataObjectManager($this, 'DataSheets', 'DataSheet', array('Participants' => 'Total Participants', 'EstVolume' => 'Estimated Volume', 'Image' => 'Image'), 'getCMSFields_forPopup');
$oFields->addFieldToTab("Root.Content.DataSheets", $oDataSheets);
// Return the fields
return $oFields;
}
开发者ID:SustainableCoastlines,项目名称:loveyourwater,代码行数:22,代码来源:DataEntryPage.php
示例4:
<?php
Admin::model('App\\Marker')->title('Маркеры')->display(function () {
$display = AdminDisplay::datatables();
$display->with('markerGroups');
$display->filters([]);
$display->columns([Column::string('name')->label('Имя'), Column::lists('markerGroups.name')->label('Входит в группы'), Column::image('ico')->label('Иконка')]);
return $display;
})->create(function () {
$form = AdminForm::form();
$form->items([FormItem::columns()->columns([[FormItem::text('name', 'Имя'), FormItem::image('ico', 'Иконка'), FormItem::checkbox('showadd', 'Показывать в форме добавления рецепта')->defaultValue(0), FormItem::text('sortorder', 'Порядок сортировки')], [FormItem::text('metakey', 'Meta Keywords'), FormItem::text('metadesk', 'Meta Description'), FormItem::text('slug', 'Slug (если пустое, генерируется реалтайм из имени)'), FormItem::text('title', 'Title')]])]);
return $form;
})->edit(function () {
$form = AdminForm::form();
$form->items([FormItem::columns()->columns([[FormItem::text('name', 'Имя'), FormItem::image('ico', 'Иконка'), FormItem::checkbox('showadd', 'Показывать в форме добавления рецепта'), FormItem::text('sortorder', 'Порядок сортировки')], [FormItem::text('metakey', 'Meta Keywords'), FormItem::text('metadesk', 'Meta Description'), FormItem::text('slug', 'Slug (если пустое, генерируется реалтайм из имени)'), FormItem::text('title', 'Title')]])]);
return $form;
});
开发者ID:AngryGantz,项目名称:cms-cookbook,代码行数:17,代码来源:Marker.php
示例5: switch
Admin::model(\App\Models\AddonsType::class)->title('Addons Types')->denyEditingAndDeleting(function ($instance) {
return false;
})->columns(function () {
Column::string('id', 'Id');
Column::string('code', 'Code')->inlineEdit(true);
Column::string('name', 'Name')->inlineEdit(true);
})->inlineEdit(function ($field) {
switch ($field) {
case 'code':
return function () {
InlineEditItem::text('code', NULL)->validationRule('required');
};
break;
case 'name':
return function () {
InlineEditItem::text('name', NULL)->validationRule('required');
};
break;
default:
return function () {
};
break;
}
})->form(function () {
FormItem::text('code', 'Code')->validationRule('required');
FormItem::text('name', 'Name')->validationRule('required');
})->viewFilters(function () {
ViewFilter::text('code', 'Code');
ViewFilter::text('name', 'Name');
});
开发者ID:procoders,项目名称:printrock,代码行数:30,代码来源:AddonType.php
示例6:
<?php
Admin::model('App\\About')->title('About')->display(function () {
$display = AdminDisplay::table();
$display->columns([Column::string('description')->label('description')]);
return $display;
})->createAndEdit(function () {
$form = AdminForm::form();
$form->items([FormItem::ckeditor('description', 'Description')->required()]);
return $form;
});
开发者ID:svvpro,项目名称:artem_project,代码行数:11,代码来源:About.php
示例7:
<?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
示例8:
<?php
Admin::model('App\\Permit')->title('Права доступа')->display(function () {
$display = AdminDisplay::datatables();
$display->with();
$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('name', 'Name'), FormItem::text('slug', 'Slug')]);
return $form;
});
开发者ID:AngryGantz,项目名称:cms-cookbook,代码行数:13,代码来源:Permit.php
示例9:
<?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
示例10:
<?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
示例11: textarea
public static function textarea($name, $value, $label = '', $htmlAttributes = array())
{
$itemData = array();
$itemData['name'] = $name;
$itemData['value'] = $value;
$itemData['label'] = $label;
if ($label !== null && !isset($htmlAttributes['id'])) {
$itemData['id'] = $name;
}
$itemData = array_merge($itemData, $htmlAttributes);
$item = new FormItem($itemData);
$output = $item->renderLabel();
$output .= '<textarea';
$output .= $item->renderAttributes(true);
$output .= '>';
$output .= $item->value;
$output .= '</textarea>' . "\n";
return $output;
}
开发者ID:suricate-php,项目名称:framework,代码行数:19,代码来源:FormItem.php
示例12:
<?php
Admin::model(App\Models\Task::class)->title('Задачи')->with('subject')->filters(function () {
})->columns(function () {
Column::string('number_task', 'Number_task');
Column::image('image')->sortable(false);
Column::string('experience', 'Experience');
Column::string('gold', 'Gold');
Column::string('grade', 'Grade');
Column::string('subject.name', 'Subject')->append(Column::filter('subject_id')->value('subject_id'));
Column::string('answer', 'Answer');
Column::string('detail', 'detail');
Column::string('set_of_task', 'Set_of_task');
})->form(function () {
FormItem::text('number_task', 'Number Task');
FormItem::image('image', 'Image');
FormItem::text('experience', 'Experience');
FormItem::text('gold', 'Gold');
FormItem::text('grade', 'Grade');
FormItem::select('subject_id', 'Subject')->list(App\Models\Subject::class);
FormItem::text('answer', 'Answer');
FormItem::text('detail', 'detail');
FormItem::text('set_of_task', 'Set Of Task');
});
开发者ID:Aglok,项目名称:upbrain,代码行数:24,代码来源:Task.php
示例13:
<?php
/*
* This is a simple example of the main features.
* For full list see documentation.
*/
Admin::model('App\\Models\\Sector')->title('Sectors')->alias('sector')->display(function () {
$display = AdminDisplay::datatablesAsync();
$display->order([[0, 'asc']]);
$display->columns([Column::string('id')->label('Id'), Column::string('name')->label('Name'), Column::datetime('created_at')->format('d-m-Y h:i:s')->label('Created'), Column::datetime('updated_at')->format('d-m-Y h:i:s')->label('Updated')]);
$display->columnFilters([null, ColumnFilter::text()->placeholder('Name'), ColumnFilter::range()->from(ColumnFilter::date()->format('d.m.Y')->placeholder('From Date'))->to(ColumnFilter::date()->format('d.m.Y')->placeholder('To Date')), ColumnFilter::range()->from(ColumnFilter::date()->format('d.m.Y')->placeholder('From Date'))->to(ColumnFilter::date()->format('d.m.Y')->placeholder('To Date'))]);
return $display;
})->createAndEdit(function () {
$form = AdminForm::form();
$form->items([FormItem::text('name', 'Name')->required()]);
return $form;
});
开发者ID:AccessibilityNL,项目名称:User-Testing-Tool,代码行数:17,代码来源:Sector.php
示例14: getSettings
public function getSettings()
{
$skins = ['blue' => 'Blue', 'blue-light' => 'Blue Light', 'black' => 'Black', 'black-light' => 'Black Light', 'purple' => 'Purple', 'purple-light' => 'Purple Light', 'green' => 'Green', 'green-light' => 'Green Light', 'red' => 'Red', 'red-light' => 'Red Light', 'yellow' => 'Yellow', 'yellow-light' => 'Yellow Light'];
$items = [\FormItem::select('theme.skin', 'Theme Skin')->options($skins)->defaultValue(\SoaUserSetting::get('theme.skin', config('admintheme.skin'))), \FormItem::checkbox('theme.fixed_layout', 'Fixed Layout')->defaultValue(\SoaUserSetting::get('theme.fixed_layout', config('admintheme.fixed_layout')))->help_text('You can\'t use fixed and boxed layouts together.'), \FormItem::checkbox('theme.boxed_layout', 'Boxed Layout')->defaultValue(\SoaUserSetting::get('theme.boxed_layout', config('admintheme.boxed_layout')))->help_text('You can\'t use fixed and boxed layouts together.'), \FormItem::checkbox('theme.sidebar_mini', 'Minimize Sidebar')->defaultValue(\SoaUserSetting::get('theme.sidebar_mini', config('admintheme.sidebar_mini'))), \FormItem::checkbox('theme.toggle_sidebar', 'Toggle Sidebar')->defaultValue(\SoaUserSetting::get('theme.toggle_sidebar', config('admintheme.toggle_sidebar')))->help_text('Toggle the left sidebar\'s state (open or collapse)'), \FormItem::checkbox('theme.sidebar_on_hover', 'Sidebar on Hover')->defaultValue(\SoaUserSetting::get('theme.sidebar_on_hover', config('admintheme.sidebar_on_hover')))->help_text('Let the sidebar mini expand on hover')];
return $this->render(trans('admin::lang.settings'), view(AdminTemplate::view('pages.admin_settings'), compact('items')));
}
开发者ID:pseudoagentur,项目名称:soa-sentinel,代码行数:6,代码来源:AdminController.php
示例15:
<?php
// Invoices
Admin::model('\\App\\Subscription')->title('Subscriptions')->as('subscriptions')->with('user')->with('invoice')->denyCreating(function () {
// Deny creating on thursday
return false;
})->denyEditingAndDeleting(function ($instance) {
// deny editing and deleting rows when this is true
return false;
})->filters(function () {
//ModelItem::filter('user_id')->name()->from('\User');
})->columns(function () {
// Describing columns for table view
Column::string('user.name', 'User');
Column::string('invoice.description', 'Invoice');
Column::date('start_date', 'Start Date');
Column::date('end_date', 'End Date');
Column::date('created_at', 'Created');
})->form(function () {
FormItem::select('user_id', 'Users')->list(\App\User::class);
FormItem::select('invoice_id', 'Invoices')->list(\App\Invoice::class);
FormItem::date('start_date', 'Start Date');
FormItem::date('end_date', 'End Date');
});
开发者ID:strikles,项目名称:php,代码行数:24,代码来源:Subscription.php
示例16:
<?php
Admin::model('\\Country')->title('Countries')->with('contacts')->columns(function () {
Column::string('title', 'Title');
Column::count('contacts', 'Contacts')->append(Column::filter('country_id')->model('\\Contact'));
})->form(function () {
FormItem::text('title', 'Title')->required()->unique();
});
开发者ID:tldmic,项目名称:admin_demo,代码行数:8,代码来源:Country.php
示例17:
<?php
Admin::model(\App\Models\Menuitem::class)->title('Пункты меню')->display(function () {
$display = AdminDisplay::datatables();
$display->with();
$display->filters([]);
$display->columns([Column::string('name')->label('Название'), Column::string('menu.name'), Column::string('id')->label('Id')]);
return $display;
})->createAndEdit(function () {
$form = AdminForm::form();
$form->items([FormItem::columns()->columns([[FormItem::text('name', 'Название'), FormItem::text('target', 'Ссылка (Если тип НЕ Группа маркеров)'), FormItem::select('parent_id', 'Родительский пункт')->defaultValue(0)->model('App\\Models\\Menuitem')->display('name'), FormItem::select('type_id', 'Тип пункта')->model('App\\Models\\MenuitemType')->display('name')], [FormItem::select('menu_id', 'В какое меню входит')->model('App\\Models\\Menu')->display('name'), FormItem::select('markerGroup_id', 'Группа маркеров (если тип пункта Группа Маркеров)')->model('App\\MarkerGroup')->display('name'), FormItem::select('marker_id', 'Маркер (если тип пункта Маркер)')->model('App\\Marker')->display('name')]])]);
return $form;
});
开发者ID:AngryGantz,项目名称:cms-cookbook,代码行数:13,代码来源:Menuitem.php
示例18:
<?php
Admin::model(\App\Models\News::class)->title('News')->with()->filters(function () {
})->columns(function () {
Column::string('title', 'Title');
Column::date('date', 'Date')->format('medium', 'none');
Column::string('published', 'Published');
// Column::string('text', 'Text');
Column::image('photo', 'Photo')->sortable(false);
})->form(function () {
FormItem::text('title', 'Title')->required();
FormItem::date('date', 'Date')->required();
FormItem::checkbox('published', 'Published')->required();
FormItem::image('photo', 'Photo');
FormItem::ckeditor('text', 'Text')->required();
});
开发者ID:nvchernov,项目名称:tsargrad,代码行数:16,代码来源:News.php
示例19:
<?php
/*
* This is a simple example of the main features.
* For full list see documentation.
*/
Admin::model('App\\User')->title('Users')->display(function () {
$display = AdminDisplay::table();
$display->columns([Column::string('name')->label('Name'), Column::string('email')->label('Email')]);
return $display;
})->alias('users')->createAndEdit(function () {
$form = AdminForm::form();
$form->items([FormItem::text('name', 'Name')->required(), FormItem::text('email', 'Email')->required()->unique()]);
return $form;
});
开发者ID:androidrf992,项目名称:simple-blog,代码行数:15,代码来源:User.php
示例20:
<?php
Admin::model('App\\News4')->title('News')->alias('news4')->display(function () {
$display = AdminDisplay::table();
$display->filters([Filter::scope('last')->title('Latest News'), Filter::field('published')->title(function ($value) {
return $value ? 'Published' : 'Not Published';
}), Filter::custom('limit')->title(function ($value) {
return 'Custom Filter: ' . $value;
})->callback(function ($query, $value) {
$query->limit($value);
})]);
$display->columns([Column::string('title')->label('Title'), Column::datetime('date')->label('Date')->format('d.m.Y'), Column::custom()->label('Published')->callback(function ($instance) {
return $instance->published ? '✓' : '-';
})]);
return $display;
})->createAndEdit(function () {
$form = AdminForm::form();
$form->items([FormItem::text('title', 'Title')->required(), FormItem::date('date', 'Date')->required()->format('d.m.Y'), FormItem::checkbox('published', 'Published'), FormItem::ckeditor('text', 'Text')]);
return $form;
});
开发者ID:ntamvl,项目名称:admin-3-demo,代码行数:20,代码来源:News4.php
注:本文中的FormItem类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论