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


PHP FormItem::time方法代碼示例

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


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

示例1:

<?php

Admin::model(App\TimeSlot::class)->title('Time Slots')->with()->filters(function () {
})->columns(function () {
    Column::string('id', 'ID');
    Column::date('start', 'Start')->format('none', 'short');
    Column::date('end', 'End')->format('none', 'short');
    Column::earlyLate('type', 'Type');
})->form(function () {
    FormItem::time('start', 'Start')->required();
    FormItem::time('end', 'End')->required();
    FormItem::select('type', 'Type')->list([1 => 'Early', 0 => 'Late']);
});
開發者ID:kellychurchill,項目名稱:boothapp,代碼行數:13,代碼來源:TimeSlot.php

示例2: view

<?php

Admin::model('App\\Form')->title('Form Items')->display(function () {
    $display = AdminDisplay::table();
    $display->columns([Column::string('id')->label('ID'), Column::string('title')->label('String'), Column::datetime('created_at')->label('Created At')->format('d.m.Y H:i:s')]);
    return $display;
})->createAndEdit(function () {
    $form = AdminForm::form();
    $form->items([FormItem::columns()->columns([[FormItem::text('title', 'FormItem::text')->defaultValue('default value')->required(), FormItem::textaddon('textaddon', 'FormItem::textaddon')->addon('$')->placement('after'), FormItem::checkbox('checkbox', 'FormItem::checkbox'), FormItem::date('date', 'FormItem::date')->format('d.m.Y'), FormItem::time('time', 'FormItem::time')->format('H:i:s')->seconds(true), FormItem::timestamp('timestamp', 'FormItem::timestamp')->format('d.m.Y g:i A')], [FormItem::select('select', 'FormItem::select')->options([1 => 'First', 2 => 'Second', 3 => 'Third'])->nullable(), FormItem::custom()->display(function ($instance) {
        return view('custom_form_item', compact('instance'));
    })->callback(function ($instance) {
        $instance->custom = \Carbon\Carbon::now();
    })], [FormItem::image('image', 'FormItem::image'), FormItem::images('images', 'FormItem::images')]]), FormItem::columns()->columns([[FormItem::textarea('textarea', 'FormItem::textarea')], [FormItem::ckeditor('ckeditor', 'FormItem::ckeditor')]])]);
    return $form;
});
開發者ID:ntamvl,項目名稱:admin-3-demo,代碼行數:15,代碼來源:Form.php

示例3:

<?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');
});
開發者ID:nurolopher,項目名稱:findsport,代碼行數:31,代碼來源:Field.php

示例4:

<?php

Admin::model(App\Models\Mega::class)->title('Megas')->with()->filters(function () {
})->columns(function () {
    Column::string('string', 'String');
})->form(function () {
    FormItem::text('string', 'String')->required();
    FormItem::text('integer', 'Integer')->required()->validationRule('integer');
    FormItem::image('image', 'Image');
    FormItem::checkbox('boolean', 'Boolean');
    FormItem::date('date', 'Date')->required();
    FormItem::time('time', 'Time')->required();
    //->seconds(true);
    FormItem::select('choices', 'Choices')->enum(['foo', 'bar']);
    FormItem::ckeditor('text', 'Text')->required();
});
開發者ID:nvchernov,項目名稱:tsargrad,代碼行數:16,代碼來源:Mega.php


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