Typo3 Neos:如何使用'TYPO3'从拼写中传递参数。Neos:插件'?



我想通过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]:

我的问题是如何将node属性中的"artist"值添加到控制器操作中?像这个

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 TYPO3TYPO3CRDomainModelNode $currentNode */
$currentNode = $this->request->getInternalArgument('__node');

在这里可以找到一些额外的提示

最新更新