无法确定扩展程序和插件的默认控制器 [英] The default controller for extension and plugin can not be determined

查看:55
本文介绍了无法确定扩展程序和插件的默认控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下午好,亲爱的朋友们!全部,我放弃.尝试得很好,所有这些都已经成为可能. TYPO3 7.6.16

Good afternoon, dear friends! All, I give up. Tried well, all that was already possible. TYPO3 7.6.16

ext_tables.php:

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:

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')
);

不断出现同样的错误 无法确定扩展名"Fecomments"和插件"Pi1"的默认控制器

And constantly the same mistake The default controller for extension "Fecomments" and plugin "Pi1" can not be determined

我阅读的主题有同样的错误,但没有帮助.

I read topics with same error but nothing help me.

我已经进入内核,发现$ configuration ['controllerConfiguration']是一个空数组,我不知道为什么数据没有到达那里.同志们,帮帮我,老实说,我不知道该怎么办! )

I already climbed into the kernel, found out that $configuration ['controllerConfiguration'] is an empty array, I do not know why data does not arrive there. Comrades, help me out, I do not know what to do, honestly! )

推荐答案

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

At first, use the correct syntax for the two files. Examples:

ext_tables.php:

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:

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
);

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

The make sure the namespace and class name are fine:

typo3conf/ext/extensionkey/Classes/Controller/FirstController.php:

typo3conf/ext/extensionkey/Classes/Controller/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文件,则会刷新 ALL 缓存.

Clear all caches. Sometimes it will help to go into ExtensionManager and disable/enable the whole extension. In case of changed classnames or changes in the tables/localconf files, this will flush ALL caches.

这篇关于无法确定扩展程序和插件的默认控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆