本文整理汇总了PHP中FormItem::textAddon方法的典型用法代码示例。如果您正苦于以下问题:PHP FormItem::textAddon方法的具体用法?PHP FormItem::textAddon怎么用?PHP FormItem::textAddon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormItem
的用法示例。
在下文中一共展示了FormItem::textAddon方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<?php
// Invoices
Admin::model('\\App\\Invoice')->title('Invoices')->as('invoices')->denyCreating(function () {
// Deny creating on thursday
return false;
})->denyEditingAndDeleting(function ($instance) {
// deny editing and deleting rows when this is true
return false;
})->columns(function () {
// Describing columns for table view
Column::string('price', 'Price');
Column::string('description', 'Description');
Column::date('created_at', 'Created');
})->form(function () {
// Describing elements in create and editing forms
FormItem::textAddon('price', 'Price')->addon('$')->placement('after');
FormItem::text('description', 'Description');
});
示例2:
<?php
/**
* Created by PhpStorm.
* User: nursultan
* Date: 3-Jul 15
* Time: 22:50
*/
Admin::model(\App\Field::class)->title('Fields')->with('infrastructures', 'city', 'category', 'cover')->columns(function () {
Column::string('name', 'Name');
Column::string('opens', 'Opens');
Column::string('closes', 'Closes');
Column::string('roof', 'Roof');
Column::string('price', 'Price');
Column::string('phoneNumber', 'PhoneNumber');
Column::string('address', 'Address');
Column::string('description', 'Description');
Column::string('longitude', 'Longitude');
Column::string('latitude', 'Latitude');
})->form(function () {
FormItem::text('name');
FormItem::time('opens');
FormItem::time('closes');
FormItem::checkbox('roof', 'Roof');
FormItem::textAddon('price')->addon('Сом')->placement('after');
FormItem::text('phoneNumber');
FormItem::text('address');
FormItem::textarea('description');
FormItem::text('longitude');
FormItem::text('latitude');
});