TYPO3 4.7.2 include extbase plugin via typoscript

不想你离开。 提交于 2019-12-10 16:12:14

问题


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


回答1:


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
        }
    }
}


来源:https://stackoverflow.com/questions/12287145/typo3-4-7-2-include-extbase-plugin-via-typoscript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!