繁体   English   中英

TYPO3动态更改tca配置类型

[英]TYPO3 change tca config type dynamically

我想根据先前的字段值更改tca字段配置类型。 例如,有两个字段field_one和field_two,如下所示

'field_one' => array(
 'exclude' => 0,
 'label' => 'field1',
 'config' => array(
  'type' => 'select',
  'foreign_table' => 'tx_ext_domain_model_field',
  'default' => 1,
  'minitems' => 0,
  'maxitems' => 1,
 ),
),

'field_two' => array(
 'exclude' => 0,
 'label' => 'field two',
 'config' => array(
  'type' => 'input',
  'eval' => 'trim'
 ),
),

这里我需要的是,如果field_one的值为2,我需要为field_two加载不同的完整配置数组。

我们怎样才能做到这一点?

检查http://docs.typo3.org/typo3cms/TCAReference/Reference/Ctrl/Index.html以获取条目typerequestUpdate

由于字段配置是静态的,因此无法更改它们。 但是,您可以更改视觉外观(字段顺序)。

我建议创建两个不同的字段。

您想签出displayCond

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM