本文介绍了如何使用extbase在TYPO3 CMS 6.0上引导插件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过TYPO3 CMS 6.0上的错字使用extbase插件.我使用以下代码,发现在网络上反复出现:

I'm trying to use an extbase plugin through typoscript on TYPO3 CMS 6.0. I used the following code, that I found repeated all over the web:

10 = USER
10 { 
    userFunc = tx_extbase_core_bootstrap->run
    pluginName = Sermons
    extensionName = VmfdsSermons
    switchableControllerActions {
        Sermon {
            1 = byLatestSeries
            2 = list
            3 = show
    }
}

但是,这只会给我以下错误:

However, this just gives me the following error:

#1289386765: Could not analyse class:Tx_VmfdsSermons_Controller_SermonController maybe not loaded or no autoloader?

在我看来,好像tx_extbase_core_bootstrap->run尚未使用名称空间,因此尝试在应调用\TYPO3\VmfdsSermons\Controller\SermonController的情况下加载名为Tx_VmfdsSermons_Controller_SermonController的类.有办法解决吗?

It seems to me as if tx_extbase_core_bootstrap->run is not using namespaces yet, thus trying to load a class called Tx_VmfdsSermons_Controller_SermonController when it should have called \TYPO3\VmfdsSermons\Controller\SermonController. Is there a way around this?

推荐答案

您正在搜索属性vendorName.因此,在您的情况下应该是:

You're searching for the property vendorName. So in your case it should be:

10 = USER
10 { 
    userFunc      = TYPO3\CMS\Extbase\Core\Bootstrap->run

    pluginName    = Sermons
    extensionName = VmfdsSermons
    vendorName    = TYPO3
    [...]

我还在ext_localconf.php中使用了供应商名称空间:

I also used the vendor namespace within ext_localconf.php:

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
    '<Vendor>.' . $_EXTKEY, 
    [...]

我通过使用调试器找到了答案.我从\TYPO3\CMS\Extbase\Mvc\Dispatcher::resolveController()开始,然后跳到TYPO3\CMS\Extbase\Mvc\Request::getControllerObjectName().有一个成员controllerVendorName,因此我在Extbase中搜索了\TYPO3\CMS\Extbase\Mvc\Request::setControllerVendorName()的二传手,正好是setControllerVendorName,并在\TYPO3\CMS\Extbase\Mvc\Web\RequestBuilder::build()中找到了一个匹配项,其中一个名为vendorName的成员,就在答案是\TYPO3\CMS\Extbase\Mvc\Web\RequestBuilder::loadDefaultValues()上面的方法!

I found the answer by using the debugger. I started at \TYPO3\CMS\Extbase\Mvc\Dispatcher::resolveController() and jumped into TYPO3\CMS\Extbase\Mvc\Request::getControllerObjectName(). There is a member controllerVendorName, so I searched in Extbase for the setter of \TYPO3\CMS\Extbase\Mvc\Request::setControllerVendorName(), precisely just for setControllerVendorName, and got a match in \TYPO3\CMS\Extbase\Mvc\Web\RequestBuilder::build(), where is a member called vendorName, and just in the method above \TYPO3\CMS\Extbase\Mvc\Web\RequestBuilder::loadDefaultValues(), is the answer!

这篇关于如何使用extbase在TYPO3 CMS 6.0上引导插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 14:05