一般来说,有3种选择:
我仍然会选择3号选项,因此你仍然需要一个动作.由于您添加了第二个变量,因此操作很好,您可以使用第二个操作,并且您不需要额外的代码.
有这样的扩展是相当容易的.我最近做的一个例子是这个扩展:https://github.com/sup7even/mailchimp
一般来说,你需要:
ext_localconf.php
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Sup7even.' . $_EXTKEY,
'Registration',
array(
'Form' => 'index,response,ajaxResponse'
),
array(
'Form' => 'index,response,ajaxResponse'
)
);
Run Code Online (Sandbox Code Playgroud)
ext_tables.php
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'Sup7.' . $_EXTKEY,
'Registration',
'Mailchimp'
);
Run Code Online (Sandbox Code Playgroud)
和RegistrationController.默认情况下,将调用第一个操作,在这种情况下是索引,因此您需要一个indexAction而模板必须是Templates/Registration/Index.html.