简体   繁体   English

TYPO3:在两个插件之间进行通信

[英]TYPO3: Communicate between two plugins

I have made two plugins, one will call listAction and display a list of records and the other one will call viewAction to display the selected record.我制作了两个插件,一个会调用listAction并显示记录列表,另一个会调用viewAction来显示所选记录。

How can I display a page where I have created the show plugin with the uid of the record I want to display?如何使用我要显示的记录的 uid 显示我创建了show插件的页面?

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
  'Vendor.Extension',
  'List',
  [
      \Vendor\Extension\Controller\Controller::class => 'list',
  ],
  [
      \Vendor\Extension\Controller\Controller::class => '',
  ]
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
  'Vendor.Extension',
  'View',
  [
      \Vendor\Extension\Controller\Controller::class => 'show',
  ],
  [
      \Vendor\Extension\Controller\Controller::class => '',
  ]
);

What I need to do is kind of what the extension News does but the way is done in that extension is deprecated and TYPO3 says that we have to do it using multiple plugins now.我需要做的是扩展 News 所做的事情,但不推荐使用扩展中的方式,TYPO3 说我们现在必须使用多个插件来做到这一点。

https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/10.3/Deprecation-89463-SwitchableControllerActions.html https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/10.3/Deprecation-89463-SwitchableControllerActions.ZFC336EZ883D5FC69A2

The "communication" is not between your plugins, but via the page request. “通信”不是在您的插件之间,而是通过页面请求。 Following a "more/detail"-link in your list will reload the page with additional parameters.跟随列表中的“更多/详细信息”链接将使用其他参数重新加载页面。

Here, f:link.action is, what you're looking for.在这里, f:link.action是您要查找的内容。 This ViewHelper enables you to link to a specified extension ( extensionName ), plugin ( pluginName ), controller ( controller ) and action ( action ).此 ViewHelper 使您能够链接到指定的扩展 ( extensionName )、插件 ( pluginName )、controller ( controller ) 和操作 ( action )。

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

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