在错别字中分配插件 [英] Assign plugin in typoscript
问题描述
我有一个插件http://typo3.org/extensions/repository/view/aw_consume
我将其用作工作的内容元素
I'm using it as a content element it's working
当我尝试分配给我的打字稿中的子部分时,什么都没显示
When I try to assign to a subpart in my typoscript nothing shows up
LOGOUT < plugin.tx_awconsume.widgets.menu
此插件是使用TYPO3 6.1.4上安装的extension_builder扩展名创建的
this plugin was created with the extension_builder extension installed on TYPO3 6.1.4
更新3
plugin.tx_awconsume {
view {
templateRootPath = {$plugin.tx_awconsume.view.templateRootPath}
partialRootPath = {$plugin.tx_awconsume.view.partialRootPath}
layoutRootPath = {$plugin.tx_awconsume.view.layoutRootPath}
}
persistence {
storagePid = {$plugin.tx_awconsume.persistence.storagePid}
}
features {
# uncomment the following line to enable the new Property Mapper.
# rewrittenPropertyMapper = 1
}
widgets {
menu = USER
menu {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
pluginName = FeAwConsume
extensionName = AwConsume
controller = ConsumerItem
action = list
vendorName = Alexweb
}
}
}
ext_tables.php
ext_tables.php
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
$_EXTKEY,
'FeAwConsume',
'fe_awconsume'
);
ext_localconf.php
ext_localconf.php
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Alexweb.' . $_EXTKEY,
'FeAwConsume',
array(
'ConsumerItem' => 'list, show, new, create, delete',
),
// non-cacheable actions
array(
'ConsumerItem' => 'create, delete',
)
);
我已经根据@lorenz的答案更新了代码片段,但我仍然没有输出
I have updated the code snippets according to @lorenz answer but im still getting no output
我还推送了TER 0.1.5的最新版本
I have also pushed the latest version in TER 0.1.5
更新4
仅在添加
plugin.tx_awconsume.widgets {
menu = USER
menu {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
pluginName = FeAwConsume
extensionName = AwConsume
controller = ConsumerItem
action = list
vendorName = Alexweb
}
}
从\typo3conf\ext\aw_consume\Configuration\TypoScript\setup.txt
它最初是由extension_builder扩展名放置的,但是我感觉这并不是一个好主意
Where it was originally placed by the extension_builder extension however I got a feeling that this is not really a good idea
推荐答案
如果仔细查看ext_localconf.php,您会注意到您使用了供应商名称.供应商名称应以大写字母开头,因此您的 ext_localconf.php 应显示为:
If you have a close look at your ext_localconf.php, you will notice that you use a vendor name. The vendor name should start with Uppercase so your ext_localconf.php should read:
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Alexweb.' . $_EXTKEY,
'MyPlugin',
array(
'ConsumerItem' => 'list, show, new, create, delete',
),
array(
'ConsumerItem' => 'create, delete',
)
);
您的 ext_tables.php 应该如下所示:
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
$_EXTKEY,
'MyPlugin',
'Speaking name of my plugin'
);
您插件的TypoScript对象应包含供应商名称(该属性是vendorName而不是vendor):
The TypoScript object of your plugin should include the vendor name (the property is vendorName, not vendor):
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
pluginName = MyPlugin
extensionName = AwConsume
vendorName = Alexweb
controller = ConsumerItem
action = list
请记住,您的类还必须包含供应商名称/使用正确的名称空间:
Keep in mind that your classes also must include the vendor name/make use of the correct namespace:
namespace Alexweb\AwConsume\Controller;
class ConsumerItemController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
}
那你应该没事.
扩展名是扩展名的UpperCamelCase变体,因此,如果扩展名是"aw_consume",则扩展名是"AwConsume".该名称在课程中使用
The extension name is the UpperCamelCase variant of your extension key, so if your extension key is "aw_consume", your extension name is "AwConsume". This name is used in the classes
插件名称是扩展中特定插件的名称.由于扩展中可以有许多插件,因此您应该为其选择一个合适的名称.插件名称也应为UpperCamelCase.您可以为同一控制器使用多个插件,因此不必像控制器一样命名插件.
The plugin name is the name of a particular plugin that is part of your extension. Since there can be many plugins in an extension, you should choose a fitting name for it. The plugin name should also be UpperCamelCase. You can have multiple plugins for the same controllers, therefore the plugin doesn't have to be named like the controller.
另请参见 http://forge.typo3.org/projects/typo3v4-mvc/wiki/FAQ#What-is-the-Extension-Name
这篇关于在错别字中分配插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!