[英]Plugin options from FlexForms in TYPO3
我使用扩展构建器构建了一个扩展,并为此添加了一个插件。 我想在将插件添加到页面时添加插件选项,这将确定该页面的控制器操作。 假设我有两个页面List
和Search
,我应该能够给插件选项选择MyExtController->list
for List
页面和MyExtController->search
Search
页面。
到目前为止我这样做了:
在我的ext_tables.php
:
$pluginSignature = str_replace('_','',$_EXTKEY) . 'myext';
$TCA['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($pluginSignature, 'FILE:EXT:' . $_EXTKEY . '/Configuration/FlexForms/flexform_myext.xml');
我在Configuration/FlexForms:
<T3DataStructure>
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>Function</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<switchableControllerActions>
<TCEforms>
<label>Select function</label>
<config>
<type>select</type>
<items>
<numIndex index="0">
<numIndex index="0">List</numIndex>
<numIndex index="1">MyExtController->list</numIndex>
</numIndex>
<numIndex index="1">
<numIndex index="0">Search</numIndex>
<numIndex index="1">MyExtController->search</numIndex>
</numIndex>
</items>
</config>
</TCEforms>
</switchableControllerActions>
</el>
</ROOT>
</sDEF>
</sheets>
</T3DataStructure>
不知何故,我想我错过了一些东西。 这不起作用。 我做得对吗? 我没有看到任何插件选项。
你错过了$pluginSignature
的下划线它应该是:
$pluginSignature = str_replace('_','',$_EXTKEY) . '_myext'
// ^-here
还要记住'_myext'
应该是你的插件的较低的名称(没有ext)(你注册为registerPlugin
方法的第二个参数的字符串)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.