esit/selectwizard

这个扩展是针对开源CMS Contao的后端小部件,它提供了一个可变的选择字段列表。

安装: 284

依赖项: 0

建议者: 0

安全: 0

星星: 0

关注者: 1

分支: 2

开放问题: 0

类型:contao-bundle

1.0.12 2023-04-17 07:45 UTC

This package is auto-updated.

Last update: 2024-09-17 10:51:50 UTC


README

PHP >= 8.0 Tested with Contao 4.9 | 4.13 | 5.1 PHPStan Level 9

这个扩展是针对开源CMS Contao的后端小部件,类似于 listWizard。有时我们需要允许用户从一定数量的选项中选择任意多个。为此,这个扩展提供了 selectmenuWizard 小部件。这是一个可变的选择字段列表。

此扩展面向开发者,因为必须在DCA中定义字段。可以执行Contao为DCA提供的常见设置。

作者

e@sy Solutions IT: Patrick Froch info@easySolutionsIT.de

许可证

此项目采用LGPLv3许可证 - 有关详细信息,请参阅 LICENSE 文件

要求

  • php: ~8.0
  • contao/core-bundle: ~4.9|^5.1

安装

Contao Manager 中搜索 SelectWizard 并安装。

入门

示例配置

<?php
// YOUR_EXTENSION/Resources/contao/dca/tl_demotable.php

/* set table name */
$table = 'tl_demotable';

/* palettes */
$GLOBALS['TL_DCA'][$table]['palettes']['default'] = '{testfield_legend},testfield;';

/* field */
$GLOBALS['TL_DCA'][$table]['fields']['testfield'] = [
    'label'     => &$GLOBALS['TL_LANG'][$table]['testfield'],
    'inputType' => 'selectmenuWizard',
    'options'   => [1 => 'Test 001', 2 => 'Test 002'],
    'eval'      => ['tl_class'=>'w50', 'includeBlankOption'=>true],
    'sql'       => 'text NOT NULL'
];

限制

  • submitOnChange 不工作,但这也没有太多意义,因为这对于子面板等非常重要。但在这里不能使用,因为它不只有一个值。

输出

Ausgabe

运行测试

在扩展目录中执行以下操作

$> build/runtest.sh