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

math5005 at gmx.de math5005 at gmx.de
Wed Aug 10 20:45:27 CEST 2011


> Welcome to PHP, TYPO3, Extbase and Fluid - impressive, that's one big mouthful ;)
The first couple of days were rather frustrating but as far as PHP itself is concerned I can rely on some really experienced co-workers. Typo3 + extbase are a different beast though but I worked myself through it.
> 
> 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
That did indeed sound like a fast and easy solution but I couldn't find /use the method getOriginalRequest -> call to undefined method :-(  I'll take a look again but because I'm running out of time (and had to fix some other bugs as well) I came up with another "solution": 

When I run into an error I'm doing a forward, but not to my errorAction but back to the action I was coming from (and to which I wanted to link back from the errorpage). The error message is displayed above and everything else is as it's supposed to be. It works (so far, probably needs more testing), so let's hope the client likes this approach as well. 


More information about the TYPO3-project-typo3v4mvc mailing list