无法确定扩展和插件的默认控制器

时间:2017-04-22 07:30:05

标签: typo3 extbase typo3-7.6.x

亲爱的朋友们,下午好!全部,我放弃了。尽力而为,一切都已经成为可能。 TYPO3 7.6.16

ext_tables.php:

<?php

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

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
    'MyVendor.' . $_EXTKEY,
    'Pi1',
    'The inventory list'
);

ext_localconf.php:

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

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
    'MyVendor.' . $_EXTKEY,
    'Pi1',
    Array ('Comment' => 'list'),
    Array ('Comment' => 'list')
);

并且经常出现同样的错误 扩展的默认控制器&#34; Fecomments&#34;和插件&#34; Pi1&#34;无法确定

我读了相同错误的主题,但没有任何帮助。

我已经爬进了内核,发现$ configuration [&#39; controllerConfiguration&#39;]是一个空数组,我不知道为什么数据不会到达那里。同志们,帮帮我吧,我不知道该怎么办,说实话! )

3 个答案:

答案 0 :(得分:1)

首先,对两个文件使用正确的语法。例子:

ext_tables.php:

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

call_user_func(
    function($extKey)
    {
        \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
            'VENDOR.Extensionkey',
            'Pi1',
            'Extension Display Name'
        );
    },
    $_EXTKEY
);

ext_localconf.php:

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

call_user_func(
    function($extKey)
    {

        \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
            'VENDOR.' . $extKey,
            'Pi1',
            [
                'First' => 'action1, action2'
            ],
            // non-cacheable actions
            [
                'First' => ''
            ]
        );
    },
    $_EXTKEY
);

确保命名空间和类名称正常:

typo3conf / EXT / extensionkey /类别/控制器/ FirstController.php:

/***
 *
 * This file is part of the "extensionkey" Extension for TYPO3 CMS.
 *
 * For the full copyright and license information, please read the
 * LICENSE.txt file that was distributed with this source code.
 *
 *  (c) 2017
 *
 ***/
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;

/**
 * FilecollectorController
 */
class FirstController extends ActionController
{

    /**
     * action1
     *
     * @return void
     */
    public function action1Action()
    {

    }

    /**
     * action1
     *
     * @return void
     */
    public function action2Action()
    {

    }

}

清除所有缓存。有时它会有助于进入ExtensionManager并禁用/启用整个扩展。如果更改了表名或更改了表/ localconf文件,则会刷新所有缓存。

答案 1 :(得分:0)

答案 2 :(得分:0)

Mikael提供的解决方案目前无法使用。

外部网站的短版,当前处于离线状态: 尝试删除并重新创建页面上的content元素,以删除旧的flexform值