当我尝试在TCA中添加名为Wizard_geo_selector的向导时,出现错误“模块未注册”。请告诉我如何在TCA中正确注册向导。
在TYPO3版本7.6中,添加了新的向导,如下所示:
Configuration/Backend/
Routes.php
,它将自动找到,无需提及in ext_localconf.php
或是ext_tables.php
必需的。如果仍然需要Ajax,则可以将文件添加AjaxRoutes.php
到同一文件夹中。内容Routes.php
:
return array(
'my_wizard_element' => array(
'path' => '/wizard/tx_geoselecotor/geo_selector_wizard',
'target' => \Path\To\your\class\WizardGeoSelector::class . '::WizardAction'
),
);
的内容 AjaxRoutes.php
<?php
/**
* Definitions for routes provided by EXT:backend
* Contains all AJAX-based routes for entry points
*
* Currently the "access" property is only used so no token creation + validation is made
* but will be extended further.
*/
return array('my_ajax_element' => array(
'path' => 'tx_geoselecotor/my_ajax_route',
'target' => \Path\To\your\class\MyAjaxController::class .'::myAjaxFunction'
));
如果不确定这种表示法,可以将其与后端的“全局变量”中的现有条目进行比较:
导航到系统->配置->后端路由
路径的路由以不同的方式处理,对于Ajax而言,它始终以“ ajax”为前缀,因此您永远不会将其添加到路径中,否则它将是路径中的两倍。对于通用路由,关于定义的字符串没有任何更改。
现在可以使用该向导,甚至不必在ext_tables.php中对其进行定义,必须在配置区域(模块[名称])中的任何表字段中都提及该向导:
'table_field_for_wizard' => array(
'label' => 'LLL:EXT:my_extension/Resources/Private/Language/locallang.xml:table_name.tx_myextension_wizard',
'config' => array (
'type' => 'user',
'userFunc' => 'Path/to/class/without/wizard->renderForm',
'wizards' => array(
'my_wizard' => array(
'type' => 'popup',
'title' => 'MyTitle',
'JSopenParams' => 'height=700,width=780,status=0,menubar=0,scrollbars=1',
'icon' => 'EXT:' . $_EXTKEY . '/Resources/Public/img/link_popup.gif',
'module' => array(
'name' => 'my_wizard_element',
'urlParameters' => array(
'mode' => 'wizard',
'ajax' => '0',
'any' => '... parameters you need'
),
),
),
'_VALIGN' => 'middle',
'_PADDING' => '4',
),
# Optional
#'softref'=>'something',
),
),
在userFunc中,Path/to/class/without/wizard->renderForm
您必须创建一个链接到向导的按钮,然后onClick向导将使用您在Routes.php中定义的路由和可选的urlParameters打开。
目前,我从没有找到核心文档中解释的整个项目。
编辑:
有关路由的详细信息可以在这里找到:路由
渲染过程可以在这里找到:Rendering / NodeFactory您可能还应该阅读链接段落的外部上下文。
编辑2:
可以在此处找到示例扩展,有些事情永远不会100%起作用,但是向导正在起作用。该扩展适用于TYPO3版本7:https :
//github.com/DavidBruchmann/imagemap_wizard
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句