0

In TYPO3, I have two plugins on the same page, lets call them pluginA and pluginB. The page gets called with parameters for pluginA like this:

tx_pluginA[action]=show&tx_pluginA[controller]=MyController&tx_pluginA[object]=1

Now in the show action of MyController I get the object directly as parameter in the show action.

But is there an easy way I can access this object from pluginB without having to manually parse the GET parameters and retrieving the object from the database?

Of course I could inject the repository and do something like:

$pluginsParams = GeneralUtility::_GET('tx_pluginB_model');
$title = $this->pluginBRepository->findByUid($pluginsParams['model'])->getTitle();

I was just wondering if there is a cleaner way without an additional database query.

There is a similar question here: TYPO3 Extbase getArguments from other Extension but its from 2013, so maybe there is a way now.

crsdahl
  • 545
  • 4
  • 17
  • Do you have the pluginB parameters in `$this->request`? An automatic transfer to the requested object ist not possible as it's "mapped" to a special controller and plugin. – Thomas Löffler Jan 29 '22 at 13:56
  • PluginB does not have any parameters, I am only interested in the parameters from pluginA – crsdahl Jan 29 '22 at 20:26
  • So, same question with pluginA? – Thomas Löffler Jan 30 '22 at 11:18
  • Using `$this->request` I only get the parameters of the current plugin, so if I am in pluginA I get the parameters I want, but not from pluginB. If I use `$this->request` in pluginB I only get pluginB parameters which are none in my case. – crsdahl Jan 30 '22 at 13:47
  • Never tried it, but maybe it is possible to write an Middleware to map PluginA to PluginB parameters. – nito Feb 12 '22 at 19:13

0 Answers0