【问题标题】:Typo3 backend module form errorTypo3 后端模块表单错误
【发布时间】:2013-08-06 07:56:20
【问题描述】:

我不知道为什么,但是错误就消失了,没有任何改变。现在它起作用了。我没有改变任何东西。 (我多次删除缓存,所以不可能是因为缓存)

问题

我使用扩展生成器创建了一个扩展(如果有人知道任何好的文档,请给我链接,因为官方文档没有任何示例)。 我有一个表格,当我提交表格时出现错误

TYPO3 v4.7

此插件不允许操作“formSave”(控制器“Promoters”)。请检查 ext_localconf.php 中的 Tx_Extbase_Utility_Extension::configurePlugin()。

我根据错字的wiki创建了ext_localconf.php。

表格代码

<f:form action="formSave" name="" object="">
  <f:form.textfield id="emailResendInterval" name="emailResendInterval" value="" />
  <f:form.textarea cols="30" rows="5" id="emails" name="emails" value="" />
  <f:form.submit name="submit" value="Save" />
</f:form>

ext_localconf.php

<?php
if (!defined ('TYPO3_MODE')) die ('Access denied.');
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$_EXTKEY] = unserialize($_EXTCONF);
if ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$_EXTKEY]['registerSinglePlugin']) {
    // fully fletged blog
    Tx_Extbase_Utility_Extension::configurePlugin(
        $_EXTKEY,                                                                   // The extension name (in UpperCamelCase) or the extension key (in lower_underscore)
        'Promoters',                                                                        // A unique name of the plugin in UpperCamelCase
        array (                                                                     // An array holding the controller-action-combinations that are accessible
            'Promoters' => 'configuration,formSave',        // The first controller and its first action will be the default
        ),
        array(                                                                      // An array of non-cachable controller-action-combinations (they must already be enabled)
        )
    );
} else {
    Tx_Extbase_Utility_Extension::configurePlugin(
        $_EXTKEY,                                                                   // The extension name (in UpperCamelCase) or the extension key (in lower_underscore)
        'Promoters',                                                                        // A unique name of the plugin in UpperCamelCase
        array (                                                                     // An array holding the controller-action-combinations that are accessible
            'Promoters' => 'configuration,formSave',        // The first controller and its first action will be the default
        ),
        array(                                                                      // An array of non-cachable controller-action-combinations (they must already be enabled)
        )
    );

PromotersControler

class Tx_Promoters_Controller_PromotersController extends Tx_Extbase_MVC_Controller_ActionController {

    /**
     * action configuration
     *
     * @return void
     */
    public function configurationAction() {

    }

    /**
     * action formSave
     *
     * @return void
     */
    public function formSaveAction() {

    }

}

【问题讨论】:

  • 能否请您也发布您的操作?你用的是flexform吗?如果您可能需要向其中添加您的操作。
  • 如果你是这个意思,我添加了控制器。我不确定我是否使用 flexform,所以我想我不是。我刚刚使用扩展生成器制作了扩展,然后我尝试使表单正常工作。

标签: typo3 form-submit backend builder


【解决方案1】:

实际上看起来不错,但我不确定 localconf 中的 if 语句。请试试这个:

    <?php
        if (!defined ('TYPO3_MODE')) die ('Access denied.');

            // fully fletged blog
            Tx_Extbase_Utility_Extension::configurePlugin(
                $_EXTKEY,                      
                'Promoters',     
                array (
                    'Promoters' => 'configuration,formSave', 
                ),
                array(                        
                )
            );
    ?>

【讨论】:

  • 我在一些示例扩展中发现了“if”。
  • 你试过了吗?
  • 我做到了。是一样的。
  • 你的扩展配置->FlexForms中有文件夹吗?
  • 不,没有。但正如我在问题中所写,它开始工作而没有任何改变......
猜你喜欢
  • 1970-01-01
  • 2018-10-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-04-27
相关资源
最近更新 更多