[TYPO3-mvc] Reuse arguments in different action

Jonas Eberle jonas.eberle at d-mind.de
Tue Dec 2 19:21:53 CET 2014


Hi Stephan,

Am 01.12.2014 um 18:59 schrieb Stephan Schuler:
> As long as you have one plugin showing the "search options" in one section of the page and another plugin showing only the "results list" in another section, having a common argument namespace gives you exactly what you want.
>
> As soon as you change one of those plugins to use switchable controller actions (usually you make the "results" plugin responsible for both, the "listAction" as well as the "showAction" for detailed information) the whole thing crashes because the "action" argument is a GET argument, too.
> So when linking form the listAction to the showAction, not only the "results" plugin gets called to render the showAction. The "search form" receives the very same command (because it listens to the same argument namespace) which results in an exception because of not having switchable controller actions configured properly.
Yes, I realized that, too. I solved it by only using default actions in 
plugins and never (!) building links with action='...'.

I think it is a shortcoming of this approach: it only allows you to 
'merge' namespaces, but it misses possibilities to draw them apart if 
you need to.
This limits the possibilities quite hard.

I would suggest a Controller::giveMeArgumentsOfThisPlugin($nameOfPlugin) 
- approach.

Regards,
Jonas

> -----Ursprüngliche Nachricht-----
> Von: typo3-project-typo3v4mvc-bounces at lists.typo3.org [mailto:typo3-project-typo3v4mvc-bounces at lists.typo3.org] Im Auftrag von Jonas Eberle
> Gesendet: Montag, 1. Dezember 2014 12:53
> An: typo3-project-typo3v4mvc at lists.typo3.org
> Betreff: Re: [TYPO3-mvc] Reuse arguments in different action
>
> Liebe Anja,
>
> Tausend Dank!
> That's it!
>
> Regards,
> Jonas
>
>
> Am 01.12.2014 um 12:42 schrieb Anja Leichsenring:
>> Hi Jonas,
>>
>> you can share the namespace between both plugins. Both will then
>> receive all the parameters from the other one and you can act as if
>> they are not two plugins, but one.
>>
>> How this works, is described in the wiki:
>> http://wiki.typo3.org/Configurable_Plugin_Namespaces
>>
>> Good luck!
>> Anja
>>
>> On 01.12.2014 12:32, Jonas Eberle wrote:
>>> Hello,
>>>
>>> this is a common pattern that I have yet solved in different (hacky,
>>> workaroundy) ways with Extbase. I'd like to hear your oppinions:
>>>
>>> I have 1 plugin that represents a search form and 1 that represents
>>> the result list. Both need to be aware of submitted search parameters
>>> (the list because it needs to apply constraints and the search form
>>> because it needs to reflect current search constraints by prefilling fields).
>>> They need to be separate because they could be presented in different
>>> parts of one page or even solo.
>>>
>>> How do you 'share' those arguments between 2 different plugins and
>>> their respective actions?
>>>
>>>
>>> Here is how I did it in recent projects:
>>> 1) Define a HttpParametersService (just to keep it separate from the
>>> controller) that does some t3lib_div::_GP($key) to get the variables.
>>> 2) Just use $_REQUEST directly in the controller to get the key.
>>> 3) Use AJAX to drive the list (some projects need to be usable
>>> without JavaScript, so this is not always an option)
>>>
>>> Both seems awkward and non-Extbase-evangelical. Everytime I do this I
>>> crawl the web to find any more elegant solutions...
>>>
>>> Any suggestions?
>>>
>>>
>> _______________________________________________
>> TYPO3-project-typo3v4mvc mailing list
>> TYPO3-project-typo3v4mvc at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4m
>> vc
>
> --
> Neu: Portal Region Stuttgart - www.region-stuttgart.de
> Neu: emobil-in-bw.de
> Neukunde: Statistisches Landesamt BaWü
> --------------------------------
> d-mind bei Facebook: http://www.facebook.com/werbeagentur.internetagentur.stuttgart
> --------------------------------
> d-mind
> Fuchs/Weiß/Strobel GbR
> Mörikestraße 69
> 70199 Stuttgart
> Tel.: +49 711 280481-1 (Durchwahl: -18)
> Fax: +49 711 2804813
> Inhaber: Jens Fuchs, Michael Weiß, Jens Strobel www.d-mind.de
>
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc


-- 
Neu: Portal Region Stuttgart - www.region-stuttgart.de
Neu: emobil-in-bw.de
Neukunde: Statistisches Landesamt BaWü
--------------------------------
d-mind bei Facebook: http://www.facebook.com/werbeagentur.internetagentur.stuttgart
--------------------------------
d-mind
Fuchs/Weiß/Strobel GbR
Mörikestraße 69
70199 Stuttgart
Tel.: +49 711 280481-1 (Durchwahl: -18)
Fax: +49 711 2804813
Inhaber: Jens Fuchs, Michael Weiß, Jens Strobel
www.d-mind.de



More information about the TYPO3-project-typo3v4mvc mailing list