oneup/contao-backend-sortable-list-views

即使在没有父表的情况下也能使后端列表视图可排序。

1.0.4 2023-09-04 13:28 UTC

This package is auto-updated.

Last update: 2024-09-12 15:37:47 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

为Contao添加缺失的排序模式:无需父表的自定义排序。

安装

需要捆绑包

composer require oneup/contao-backend-sortable-list-views

添加路由

# config/routes.yaml

OneupContaoBackendSortableListViewsBundle:
    resource: "@OneupContaoBackendSortableListViewsBundle/config/routes.yaml"

配置

# contao/dca/tl_my_custom_table.php

// Add sorting flag
$GLOBALS['TL_DCA']['tl_my_custom_table']['list']['sorting']['sortableListView'] = true;

// Add database field
$GLOBALS['TL_DCA']['tl_my_custom_table']['fields']['sorting']['sql'] = 'int(10) unsigned NOT NULL default 0';

运行Contao迁移/数据库更新,享受快乐的拖放排序!

开发

后端

安装依赖项

composer install

运行代码风格修复器

php composer cs-fixer

运行静态分析器

php composer phpstan

运行单元测试

php composer phpunit

前端

安装依赖项

npm install

构建前端资产

npm run build