[TYPO3-mvc] multiple instances of one plugin on the same page

Xavier Perseguers typo3 at perseguers.ch
Tue Jun 8 15:33:07 CEST 2010


Hey,

I just face the very same problem ;-)

> i thought about that some time ago and propably it would be a solution
> to allow an extbase-based action to prefix the variables with some
> identifier. so if your action wants to send a value to User/LoginAction,
> it uses:
>
> tx_yourext_pi1[UserLogin][name] = value
>
> and only the User/LoginAction tries to deal with this value, all other
> actions would no be affected. for long controllerAction-names propably
> something like a short md5 hash or similar would make sense.
>
> of course you will get into trouble if you use the same controllerAction
> twice *g* but that's a pretty wired case ...

In v4, I used to prefix my parameters with a modified name including the 
uid of the plugin:

tx_yourext_pi1_123[name] = value

This is easily done with native methods:

$prefix = $this->pi_getClassName($this->cObj->data['uid']);
$arguments = t3lib_div::_GP($prefix);

Wouldn't be a solution for this case? I mean, I should be able to use 
the same plugin on a page, and run each of them completely individually 
from the others...

Xavier


More information about the TYPO3-project-typo3v4mvc mailing list