定制 ameotoko/contao-dc-sortable 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ameotoko/contao-dc-sortable

最新稳定版本:1.0.1

Composer 安装命令:

composer require ameotoko/contao-dc-sortable

包简介

Contao 5 DataContainer driver with drag'n'drop sorting support

README 文档

README

A DataContainer driver for Contao 5 CMS, that extends core DC_Table driver with custom "drag'n'drop" sorting capability.

Install

composer require ameotoko/contao-dc-sortable

Use in your data container

This is a minimal DCA configuration to make it work:

// tl_custom.php
use Ameotoko\DCSortableBundle\DataContainer\DC_TableSortable;

$GLOBALS['TL_DCA']['tl_custom'] = [
    'config' => [
        'dataContainer' => DC_TableSortable::class, // enable the driver
    ],

    'list' => [
        'sorting' => [
            'mode' => DataContainer::MODE_SORTED, // this mode is required
            'flag' => DataContainer::SORT_ASC,
            'fields' => ['sorting'] // drag'n'drop table must be sorted by the "sorting" field
        ],

        'label' => [
            // Contao will force the first sorting field to appear as a column in backend list view.
            // You can prevent this using this setting (requires Contao 5.2.8 or later).
            'showFirstOrderBy' => false
        ],

        // add the drag handle
        'operations' => [..., 'drag' => [
            'icon' => 'drag.svg',
            'attributes' => 'class="drag-handle" aria-hidden="true"',
            'button_callback' => static function ($row, $href, $label, $title, $icon, $attributes) {
                return \Contao\Image::getHtml($icon, $label, $attributes);
            }
        ]]
    ],

    // add required fields
    'fields' => [
        'id' => [
            'sql' => ['type' => Types::INTEGER, 'unsigned' => true, 'autoincrement' => true],
            'search' => true
        ],
        'sorting' => [
            'sql' => ['type' => Types::INTEGER, 'unsigned' => true, 'default' => 0]
        ],
    ]

统计信息

  • 总下载量: 41
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0-or-later
  • 更新时间: 2023-11-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固