简体   繁体   中英

TYPO3 4.7.2 include extbase plugin via typoscript

I wrote an extension and the implementation of the Plugin via backend does everything correctly.

But when I try to implement my extension via typoscript I got this error everytime:

Oops, an error occurred!

The default controller can not be determined. Please check for Tx_Extbase_Utility_Extension::configurePlugin() in your ext_localconf.php.

and I don't know why.. I have tried different implementations (per tx_extbase_core_bootstrap->run or tx_extbase_dispatcher->dispatch and with additional information and without) and the current typoscript looks like this:

plugin.tx_graphichmenu {
    settings {
        menuUid = 1
    }
}

lib.tx_graphichmenu = USER
lib.tx_graphichmenu {
    userFunc = tx_extbase_core_bootstrap->run
    extensionName = Graphichmenu
    pluginName = Graphicmenu
    controller = MenuController
    action = showAction
}

temp.mainTemplate.subparts.stickyfooter < lib.tx_graphichmenu

i double- and triple-checked everything and i found not a single fault... tried it without the "action" and "controller" part and nothing changed

my configurePlugin part in the ext_localconf.php looks like this:

Tx_Extbase_Utility_Extension::configurePlugin(
    $_EXTKEY,
    'Graphicmenu',
    array(
        'Menu' => 'show',
    ),
    // non-cacheable actions
    array(
        'Menu' => '',
    )
);

The "show" action got no parameters. in there I load the ts settings from where I take the Uid of the object to display

PS: after every change i have cleared the cache and deleted the "temp_CACHED_..." files in typo3conf

You need to modify your bootstrap, there's a general syntax:

lib.foo = USER
lib.foo {
    userFunc = tx_extbase_core_bootstrap->run
    extensionName = YourExtension
    pluginName = YourPlugin
    vendorName = YourVendor
    switchableControllerActions {
        Standard {
            1 = action2
            2 = action3
        }
    }
}

Note: CamelCase in extensionName value is important! (Thanks to Kai for confirmation) so if extkey is: kai_some_extension it has to be written as KaiSomeExtension

So in your case it should be something like:

lib.foo = USER
lib.foo {
    userFunc = tx_extbase_core_bootstrap->run
    extensionName = GraphicHmenu
    pluginName = Graphicmenu
    switchableControllerActions {
        Menu {
            1 = show
        }
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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