简体   繁体   English

TYPO3 4.7.2通过typoscript包含extbase插件

[英]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: 但是当我尝试通过typoscript实现我的扩展时,我每次都会收到此错误:

Oops, an error occurred! 糟糕,发生错误!

The default controller can not be determined. 无法确定默认控制器。 Please check for Tx_Extbase_Utility_Extension::configurePlugin() in your ext_localconf.php. 请检查ext_localconf.php中的Tx_Extbase_Utility_Extension :: configurePlugin()。

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: 我不知道为什么..我尝试了不同的实现(根据tx_extbase_core_bootstrap-> run或tx_extbase_dispatcher-> dispatch以及附加信息而没有),当前的typoscript看起来像这样:

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: 我在ext_localconf.php中的configurePlugin部分如下所示:

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

The "show" action got no parameters. “show”动作没有参数。 in there I load the ts settings from where I take the Uid of the object to display 在那里我加载ts设置从我拿到对象的Uid显示

PS: after every change i have cleared the cache and deleted the "temp_CACHED_..." files in typo3conf PS:每次更改后我都清除了缓存并删除了typo3conf中的“temp_CACHED _...”文件

You need to modify your bootstrap, there's a general syntax: 你需要修改你的bootstrap,有一般的语法:

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! 注意: extensionName值中的CamelCase很重要! (Thanks to Kai for confirmation) so if extkey is: kai_some_extension it has to be written as KaiSomeExtension (感谢Kai的确认)所以如果extkey是: kai_some_extension它必须写成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
        }
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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