简体   繁体   English

找不到扩展的TYPO3 6.0.4默认控制器

[英]TYPO3 6.0.4 default controller for extension not found

I created my third extension with the extension builder but this one won't install itself properly. 我使用扩展程序生成器创建了我的第三个扩展程序,但是此扩展程序无法正确安装。 I get the error: 我得到错误:

The default controller for extension "NtImpressions" and plugin "Gallery" can not be determined. 无法确定扩展名“ NtImpressions”和插件“ Gallery”的默认控制器。 Please check for TYPO3\\CMS\\Extbase\\Utility\\ExtensionUtility::configurePlugin() in your ext_localconf.php. 请在ext_localconf.php中检查TYPO3 \\ CMS \\ Extbase \\ Utility \\ ExtensionUtility :: configurePlugin()。

I did not modify anything in the extension files. 我没有修改扩展文件中的任何内容。 The Plugin is completly generated by the extension builder. 插件由扩展构建器完全生成。 This is the ext_localconf.php 这是ext_localconf.php

<?php
if (!defined('TYPO3_MODE')) {
    die ('Access denied.');
}    
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
    'Xxx.' . $_EXTKEY,
    'Gallery',
    array(
        'Galerie' => 'list, show',          
    ),
    array(
        'Galerie' => '',

    )
);    
?>

And the ext_tables.php 还有ext_tables.php

<?php
if (!defined('TYPO3_MODE')) {
    die ('Access denied.');
}    
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
    $_EXTKEY,
    'Gallery',
    'Galerie'
);    
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript', 'Impressionen');    
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_ntimpressions_domain_model_galerie', 'EXT:nt_impressions/Resources/Private/Language/locallang_csh_tx_ntimpressions_domain_model_galerie.xlf');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_ntimpressions_domain_model_galerie');
$TCA['tx_ntimpressions_domain_model_galerie'] = array(
    'ctrl' => array(
        'title' => 'LLL:EXT:nt_impressions/Resources/Private/Language/locallang_db.xlf:tx_ntimpressions_domain_model_galerie',
        'label' => 'bezeichnung',
        'tstamp' => 'tstamp',
        'crdate' => 'crdate',
        'cruser_id' => 'cruser_id',
        'dividers2tabs' => TRUE,    
        'versioningWS' => 2,
        'versioning_followPages' => TRUE,
        'origUid' => 't3_origuid',
        'languageField' => 'sys_language_uid',
        'transOrigPointerField' => 'l10n_parent',
        'transOrigDiffSourceField' => 'l10n_diffsource',
        'delete' => 'deleted',
        'enablecolumns' => array(
            'disabled' => 'hidden',
            'starttime' => 'starttime',
            'endtime' => 'endtime',
        ),
        'searchFields' => 'bezeichnung,beschreibung,bilder,bilder_beschreibung,',
        'dynamicConfigFile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Configuration/TCA/Galerie.php',
        'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY) . 'Resources/Public/Icons/tx_ntimpressions_domain_model_galerie.gif'
    ),
);    
?>

I guess the namespace is not set correct and TYPO3 is unable to determine your controller GalerieController->listAction . 我猜想名称空间设置不正确,并且TYPO3无法确定您的控制器GalerieController->listAction

The first part of the configurePlugin registers the namespace in TYPO3 6.0, so you need to add this namespace to all classes. configurePlugin的第一部分在TYPO3 6.0中注册了名称空间,因此您需要将此名称空间添加到所有类中。 The Namespace is parsed to the path where the file with the class can be found. 命名空间被解析到可以找到具有该类的文件的路径。 This is the equivalent to the old syntax. 这等效于旧语法。

Old syntax: 旧语法:

class Tx_YourExtension_Controller_YourController {
    //...
}

is now 就是现在

<?php
namespace YourVendor\YourExtension\Controller; 

class YourController {
    //...
}

So following configuration 所以下面的配置

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Xxx.' . $_EXTKEY,
...

registers Xxx as Vendor, so all your classes need to be in that namespace 将Xxx注册为供应商,因此所有类都必须位于该命名空间中

<?php
namespace Xxx\Gallery\Controller

class GalleryController {
    // ...
}

Where "Gallary" is you extension key in upper camel case. 其中“ Gallary”是您在大驼峰情况下的扩展键。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM