[英]Typo3 Neos: How to pass parameter from typoscript using 'TYPO3.Neos:Plugin'?
我想通过aloha编辑器动态传递参数,我在.yaml上有这样的选择框
properties:
events:
type: string
ui:
label: 'Events'
reloadIfChanged: TRUE
inspector:
group: 'document'
editor: 'TYPO3.Neos/Inspector/Editors/SelectBoxEditor'
editorOptions:
dataSourceUri: 'events/list'
在.ts2文件上,我用这个
prototype(Festival.Backend:Events) < prototype(TYPO3.Neos:Plugin) {
package = 'Festival.Backend'
controller = 'Events'
action = 'ast_view'
artist = ${q(node).property('events')}
}
在本教程http://docs.typo3.org/neos/TYPO3NeosDocumentation/Appendixes/NeosTypoScriptReference.html#中,它说我可以使用以下参数将参数传递给控制器
argumentNamespace:
[key]:
我的问题是如何将节点属性中的“艺术家”值添加到控制器操作中? 像这样的东西
public function ast_viewAction($artist) {
$this->view->assign('artist', $artist);
}
感谢您的关注
编辑:感谢Aske Ertmann解决,将我的功能更改为此
public function ast_viewAction() {
$events_artist = $this->request->getInternalArgument('__artist');
$this->view->assign('artist', $artist);
}
TypoScript插件对象的参数可用作请求中的内部参数,可在控制器操作中使用。
/** @var \TYPO3\TYPO3CR\Domain\Model\Node $currentNode */
$currentNode = $this->request->getInternalArgument('__node');
一些其他提示可以在这里找到
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.