TYPO3 6.0.4默认控制器未找到扩展名

时间:2013-04-11 14:22:30

标签: typo3 extbase

我使用扩展构建器创建了第三个扩展,但是这个扩展不会正确安装。我收到错误:

  

扩展程序“NtImpressions”和插件的默认控制器   “画廊”无法确定。请检查   TYPO3 \ CMS \ Extbase \ Utility \ ExtensionUtility :: configurePlugin()在你的   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' => '',

    )
);    
?>

和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'
    ),
);    
?>

1 个答案:

答案 0 :(得分:1)

我猜名称空间设置不正确,TYPO3无法确定您的控制器GalerieController->listAction

configurePlugin的第一部分在TYPO3 6.0中注册了命名空间,因此您需要将此命名空间添加到所有类中。将命名空间解析为可以找到具有该类的文件的路径。这相当于旧语法。

旧语法:

class Tx_YourExtension_Controller_YourController {
    //...
}

现在是

<?php
namespace YourVendor\YourExtension\Controller; 

class YourController {
    //...
}

以下配置

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

将Xxx注册为供应商,因此您的所有类都需要在该命名空间中

<?php
namespace Xxx\Gallery\Controller

class GalleryController {
    // ...
}

“Gallary”是你在上骆驼案件中的延伸钥匙。