[TYPO3-dev] How to distinguish between different save buttons?

Alexander Bigga linux at bigga.de
Wed Jun 26 09:10:33 CEST 2013


Dear Charles,

Am 25.06.2013 22:46, schrieb Charles Brunet:

> In a backend module written with extbase and fluid, I added standard
> buttons to save, save and close, save and view, and save and add. I did it
> building a custom ViewHelper, since there isn't a ViewHelper for that yet.
> In the list module, it seems the only difference between those buttons are
> their name.
>
> In my controller, how can I know which button was clicked, in order to
> redirect to the right action?

At least in Extbase/Fluid 4.7 exists a button viewhelper already. This 
didn't fit in all cases my needs, so I wrote for these special cases my 
own one.

The Fluid ViewHelper is here:

typo3/sysext/fluid/Classes/ViewHelpers/Be/Buttons/IconViewHelper.php

It allows you adding an URI with your action and arguments like this:

<f:be.buttons.icon icon="actions-edit-copy" 
uri="{f:uri.action(action:'beCopy' arguments:'{event:event}')}" 
title="<f:translate key='be.copyEvent' />" />

This is calling my beCopyAction()

Best regards,

Alexander




More information about the TYPO3-dev mailing list