Php TYPO3中FlexForms的插件选项
我使用ExtensionBuilder构建了一个扩展,并为此添加了一个插件。我想在将插件添加到页面时添加插件选项,这将决定该页面的控制器操作。假设我有两个页面Php TYPO3中FlexForms的插件选项,php,plugins,typo3,Php,Plugins,Typo3,我使用ExtensionBuilder构建了一个扩展,并为此添加了一个插件。我想在将插件添加到页面时添加插件选项,这将决定该页面的控制器操作。假设我有两个页面List和Search,我应该能够给插件选项选择MyExtController->ListforList页面和MyExtController->SearchforSearch页面 到目前为止,我做到了: 在myext\u tables.php中: $pluginSignature = str_replace('_','',$_EXTKEY)
List
和Search
,我应该能够给插件选项选择MyExtController->List
forList
页面和MyExtController->Search
forSearch
页面
到目前为止,我做到了:
在myext\u 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');
我的FlexForm在配置/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>
作用
排列
选择函数
选择
列表
MyExtController->list
搜寻
MyExtController->搜索
不知怎么的,我想我错过了什么。这是行不通的。我做得对吗?我没有看到任何插件选项 您错过了
$pluginSignature
中的下划线,它应该是:
$pluginSignature = str_replace('_','',$_EXTKEY) . '_myext'
// ^-here
还请记住,
“u myext”
应该是插件的小写名称(不是ext)(您注册为registerPlugin
方法的第二个参数的字符串)Arggh!!是的,是的!!谢谢:)