[TYPO3-mvc] Creating a dynamic back-button for error page

Claus Due claus at wildside.dk
Wed Aug 10 09:44:48 CEST 2011


Hi,

Welcome to PHP, TYPO3, Extbase and Fluid - impressive, that's one big mouthful ;)

The trick is to use forward, never redirect. If you do so, $this->request->getOriginalRequest() contains the previous request, on which you can call the ->getActionName() and ->getArguments() methods. I think this is what you are looking for - but the hinge is as mentioned that your error display action and return/original action must be placed in the same controller.

Cheers,
Claus
 
On Aug 10, 2011, at 6:41 AM, math5005 at gmx.de wrote:

> Hi all,
> 
> I'm currently working on my first extension for Typo3 (+first time usage of Typo3 + first time programming PHP ;-) ). It's almost finished and working flawless (more or less) but there's one thing that came up yesterday:
> 
> When I run into an error (i.e. I catch an exception thrown by an external script that's used to do most of the work) I redirect to my error-action and display my exception message (via flashmessage). So far so good.
> 
> What I would like to do now is display a back button that links back to the previously called action:
> ActionA -> view ActionA ->ActionB -> exception / error view (because something went wrong inside the script called by ActionB) -> link back to ActionA.
> 
> The problem is that you can get redirected to the error page from several actions so I can't use some kind of static link. And I can't use the (as it seems to me) dirty way of simply doing a javascript history.back because some actions need to realy reload when going back to them, so I need everything that was in the get-parameters for this action (ActionA above). Is there a referer stored somewhere that I could use?
> 
> Thanks for your help.
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc



More information about the TYPO3-project-typo3v4mvc mailing list