Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
298 views
in Technique[技术] by (71.8m points)

typoscript - How do I bootstrap a plugin on TYPO3 CMS 6.0 with 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?

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 TYPO3VmfdsSermonsControllerSermonController. Is there a way around this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

10 = USER
10 { 
    userFunc      = TYPO3CMSExtbaseCoreBootstrap->run

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

I also used the vendor namespace within ext_localconf.php:

TYPO3CMSExtbaseUtilityExtensionUtility::configurePlugin(
    '<Vendor>.' . $_EXTKEY, 
    [...]

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...