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


PHP FormItem::timestamp方法代码示例

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


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

示例1:

<?php

Admin::model(\Pages::class)->title('Страницы')->with()->filters(function () {
})->columns(function () {
    Column::string('id', 'ID');
    Column::string('menu_title', 'Заголовок меню');
    Column::string('title', 'Заголовок');
    Column::string('is_published', 'Статус публикации');
    Column::date('created_at', 'Дата создания')->format('medium', 'short');
    Column::date('updated_at', 'Дата обновления')->format('medium', 'short');
    Column::date('published_at', 'Дата публикации')->format('medium', 'short');
})->form(function () {
    //	FormItem::select('parent_id', 'Родитель')->enum(Pages::whereIsContainer(1)->lists('menu_title', 'id'));
    FormItem::text('parent_id', 'Родитель');
    FormItem::checkbox('is_published', 'Опубликовано');
    FormItem::checkbox('is_container', 'Может быть родителем');
    //FormItem::text('position', 'Позиция в меню');
    FormItem::text('alias', 'Алиас');
    FormItem::text('menu_title', 'Заголовок меню');
    FormItem::text('title', 'Заголовок');
    FormItem::timestamp('published_at', 'Дата публикации');
    //->seconds(true);
    FormItem::textarea('meta_title', 'Мета-тег Title')->attributes(['rows' => 4]);
    FormItem::textarea('meta_desc', 'Мета-тег Description')->attributes(['rows' => 4]);
    FormItem::textarea('meta_key', 'Мета-тег Keywords')->attributes(['rows' => 4]);
    FormItem::ckeditor('introtext', 'Краткое описание');
    FormItem::ckeditor('content', 'Контент');
});
开发者ID:Annywebart,项目名称:site,代码行数:28,代码来源:Pages.php

示例2:

<?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

示例3:

<?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

示例4:

<?php

/*
 * Создание и редактирование статей.
 * Файл Post.php
 */
Admin::model('App\\Models\\Post')->title('Article')->filters(function () {
    ModelItem::filter('PostForId')->scope('PostForId')->title('От 3 до 5');
})->columns(function () {
    Column::string('link', 'Link');
    Column::string('header', 'Header');
    Column::string('article', 'Article');
    Column::string('author', 'Author');
    Column::string('created_at', 'Created_at');
    Column::string('updated_at', 'Updated_at');
})->form(function () {
    FormItem::text('link', 'Link')->required();
    FormItem::text('header', 'Header')->required();
    FormItem::ckeditor('article', 'Article')->required();
    FormItem::text('author', 'Author')->required();
    FormItem::timestamp('created_at', 'Created_at')->required();
    FormItem::timestamp('updated_at', 'Updated_at')->required();
});
开发者ID:Aglok,项目名称:upbrain,代码行数:23,代码来源:Post.php

示例5: 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

示例6:

<?php

\Admin::model('App\\Post')->title('Posts')->alias('posts')->display(function () {
    $display = AdminDisplay::table();
    $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('alias', 'Алиас')->unique(), FormItem::bsselect('user_id', 'Пользователь')->model('App\\User')->defaultValue(Sentinel::check()->id)->display('email'), FormItem::bsselect('category_id', 'Категоря')->model('App\\Category')->display('level_label')->disableSort()->required(), FormItem::image('image', 'Картинка')]])], 'content' => [FormItem::markdown('content', 'Контент')]]);
    return $form;
});
开发者ID:larabox,项目名称:larabox,代码行数:11,代码来源:Post.php

示例7: base_path

<?php

\Admin::model('App\\Landing')->title('Landing')->alias('landing')->display(function () {
    $display = AdminDisplay::table();
    $display->with('blocks');
    $display->columns([Column::checkbox(), Column::string('id')->label('#'), Column::string('title')->label('Загаловок'), Column::string('active_status')->label('Статус'), Column::custom()->label('Блоки')->callback(function ($instance) {
        return '<a href="/admin/landing-blocks?landing_id=' . $instance->id . '">Редактировать</a>';
    })]);
    return $display;
})->edit(function ($id) {
    $form = AdminForm::tabbed();
    $fields = [];
    $fields['Main'] = [FormItem::columns()->columns([[FormItem::text('title', 'Загаловок')->required()->unique(), FormItem::textarea('description', 'Описание')->required(), FormItem::timestamp('publish', 'Дата и время публикации')->defaultValue(Carbon\Carbon::now()), FormItem::timestamp('publish_end', 'Дата и время олкончания публикация')->defaultValue(Carbon\Carbon::now()), FormItem::text('redirect', 'Редирект'), FormItem::icheckbox('active', 'Статус')->defaultValue(true)], [FormItem::text('alias', 'Алиас')->unique(), FormItem::text('name', 'Название')->required()->unique(), FormItem::image('image', 'Картинка')]])];
    $model = App\Landing::find($id);
    if ($model) {
        $path = base_path('App/AdminLanding/' . $model->name . '.php');
        if (is_file($path)) {
            $fields2 = (require_once $path);
            $fields = array_merge($fields, $fields2);
        }
    }
    $form->items($fields);
    return $form;
})->create(function ($id) {
    $form = AdminForm::tabbed();
    $fields = [];
    $fields['Main'] = [FormItem::columns()->columns([[FormItem::text('title', 'Загаловок')->required()->unique(), FormItem::textarea('description', 'Описание')->required(), FormItem::timestamp('publish', 'Дата и время публикации')->defaultValue(Carbon\Carbon::now()), FormItem::timestamp('publish_end', 'Дата и время олкончания публикация')->defaultValue(Carbon\Carbon::now()), FormItem::text('redirect', 'Редирект'), FormItem::icheckbox('active', 'Статус')->defaultValue(true)], [FormItem::text('alias', 'Алиас')->unique(), FormItem::text('name', 'Название')->required()->unique(), FormItem::image('image', 'Картинка')]])];
    $form->items($fields);
    return $form;
});
开发者ID:larabox,项目名称:larabox,代码行数:30,代码来源:Landeng.php

示例8:

        if ($instance->active) {
            return ' <span><i class="fa fa-chevron-down" data-toggle="tooltip" title="" data-original-title="Active"></i></span>';
        }
    })->orderable(false)]);
    return $display;
})->createAndEdit(function () {
    $form = AdminForm::form();
    $form->ajax_validation(true);
    $form->items([FormItem::columns()->columns([[FormItem::text('lable', 'lable'), FormItem::bsselect('user_id', 'User')->model('App\\User')->display('email')->defaultValue(Sentinel::getUser()->id), FormItem::icheckbox('active')->label('Active')->skin('flat')], [FormItem::text('comment_id', 'Page ID'), FormItem::text('comment_type')]]), FormItem::ckeditor('content', 'Content')]);
    return $form;
});
/**
 *  Sitemaps
 */
Admin::model('App\\Sitemap')->title('Sitemap')->alias('sitemaps')->display(function () {
    $display = AdminDisplay::table();
    $display->filters([Filter::field('loc')->title(function ($value) {
        return 'URL:' . $value;
    })]);
    $display->columns([Column::checkbox(), Column::string('loc')->label('loc'), Column::string('lastmod')->label('lastmod'), Column::string('changefreq')->label('changefreq'), Column::string('priority')->label('priority'), Column::string('updated_at')->label('updated_at'), Column::custom()->label('in_sitemap')->callback(function ($instance) {
        if ($instance->in_sitemap) {
            return ' <span><i class="fa fa-chevron-down" data-toggle="tooltip" title="" data-original-title="Active"></i></span>';
        }
    })->orderable(false)]);
    return $display;
})->createAndEdit(function () {
    $form = AdminForm::form();
    $form->ajax_validation(true);
    $form->items([FormItem::columns()->columns([[FormItem::text('loc', 'loc')->required(), FormItem::timestamp('lastmod', 'lastmod')->required(), FormItem::select('changefreq', 'changefreq')->enum(['always', 'hourly', 'daily', 'weekly', 'monthly', 'yearly', 'never'])->required(), FormItem::text('priority', 'priority')->required(), FormItem::icheckbox('in_sitemap')->label('In sitemap')]])]);
    return $form;
});
开发者ID:jetcms,项目名称:models,代码行数:31,代码来源:JetCmsModels.php

示例9:

<?php

Admin::model('App\\Models\\Entry')->title('Entries')->display(function () {
    $display = AdminDisplay::datatables();
    $display->with();
    $display->filters([Filter::scope('published'), Filter::scope('unpublished')]);
    $display->columns([Column::string('title')->label('Title'), Column::string('content')->label('Content'), Column::datetime('published_at')->format('H:i d.m.Y')->label('Published At'), Column::custom()->label('Published')->callback(function ($instance) {
        return $instance->published ? '&check;' : '-';
    })]);
    return $display;
})->createAndEdit(function () {
    $form = AdminForm::form();
    $form->items([FormItem::text('title', 'Title')->required(), FormItem::text('slug', 'Slug')->required(), FormItem::checkbox('published', 'Published'), FormItem::timestamp('published_at', 'Published At')->format('d.m.Y H:i:s')->seconds(true), FormItem::ckeditor('content', 'Content')->required()]);
    return $form;
});
开发者ID:proudly,项目名称:RefEng,代码行数:15,代码来源:Entry.php


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