goldenscarab / modulus-service-template
一个创建HTML列表的助手
v0.1.6
2022-02-25 13:02 UTC
Requires
- php: >=7.1.3
Requires (Dev)
- goldenscarab/modulus-helpers: 0.2.6
- laravel/framework: 5.8.x
README
一个在Bootstrap中非常容易生成HTML后台列表的助手
所需
- Composer
- PHP >= 7.2
- Laravel >= 5.8
安装
使用composer要求这个包。
composer require goldenscarab/modulus-service-template
Laravel 5.8使用包自动发现,因此不需要您手动添加ServiceProvider。
用法
// Exemple sur une liste d'utilisateurs
{!! Template::list4([
'table_id' => null,
'table_class' => 'table-sortable',
'route_prefix' => $route_prefix,
'can_prefix' => $can_prefix,
'menu' => [
'button' => [
'label' => ['template' => [
'format' => '<i class="fa fa-list mr-2"></i>Éléments<span class="badge badge-dark ml-2">%s</span>',
'args' => ['callback' => [
'function' => 'count',
'args' => ':menuItems'
]]
]],
'permission' => 'menu-read',
'href' => ['url' => [
'route' => $route_prefix . '.item.list',
'args' => [':id']
]],
],
'dropdown' => [ 'items' => [
[
'label' => '<i class="fa fa-eye mr-2"></i>Voir la page',
'permission' => 'page-read',
'href' => [
'url' => [
'template' => [
'format' => '%s%s',
'args' => [url('/'), ':uri']
]
]
],
'class' => ['condition' => [
'value' => ':status',
'operator' => '==',
'comparator' => 1,
'true' => '',
'false' => 'disabled'
]]
],
[
'label' => [
'template' => [
'format' => '<i class="fa fa-clipboard mr-2"></i>[ page|%s ]',
'args' => ':slug',
]
],
'permission' => 'page-read',
'href' => '#',
'title' => 'Copier le Tag',
'class' => 'clipboard-copy',
'data-clipboard-action' => 'copy',
'data-clipboard-text' => [
'template' => [
'format' => '[ page|%s ]',
'args' => ':slug',
]
],
],
'[READ]',
'[UPDATE]',
'[DUPLICATE]',
'[SEPARATOR]',
'[DELETE]'
]]
],
'source' => $items,
'columns' => array([
'label' => '#',
'value' => ':id',
'sortable' => 'id'
],[
'label' => 'Dossier',
'value' => ':folder_html',
'sortable' => 'ged_folders.title'
],[
'label' => 'Nom',
'value' => ':name',
'sortable' => 'name',
],[
'label' => 'Version',
'value' => ['template' => [
'format' => 'v%s',
'args' => ':version'
]],
'sortable' => 'version',
'class' => 'text-center'
],[
'label' => 'Position',
'class' => 'text-center',
'value' => ['callback' => [
'function' => 'pos_sort',
'args' => [':id', ':position']
]],
'sortable' => 'position'
],[
'label' => 'Statut',
'value' => ':validation_html',
'class' => 'text-center'
],[
'label' => 'Visibilité',
'class' => 'text-center',
'value' => ['callback' => [
'function' => 'published_html',
'args' => ':status'
]],
'sortable' => 'status',
],[
'label' => 'Date',
'value' => ':updated_at->diffForHumans()',
'sortable' => 'updated_at'
]
)
]) !!}
点击这里获取更多示例
安全
如果您发现任何与安全相关的问题,请通过contact@goldenscarab.fr发送电子邮件,而不是使用问题跟踪器。
致谢
许可
MIT许可(MIT)。有关更多信息,请参阅许可文件。