【问题标题】:Typo3 Neos: How to pass parameter from typoscript using 'TYPO3.Neos:Plugin'?Typo3 Neos:如何使用 'TYPO3.Neos:Plugin' 从打字稿中传递参数?
【发布时间】:2015-02-16 03:31:30
【问题描述】:

我想通过 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); 
}

【问题讨论】:

    标签: typo3 typoscript typo3-flow neoscms


    【解决方案1】:

    TypoScript 插件对象的参数可用作请求的内部参数,可在控制器操作中使用。

    /** @var \TYPO3\TYPO3CR\Domain\Model\Node $currentNode */
    $currentNode = $this->request->getInternalArgument('__node');
    

    可以找到一些额外的提示here

    【讨论】:

    • 对不起,我目前是这个框架的新手,恐怕我不太明白。我应该在“ast_viewAction”函数的内部/外部放置哪一行?
    猜你喜欢
    • 2015-06-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-11
    • 2014-02-05
    • 1970-01-01
    相关资源
    最近更新 更多