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

Claus Due claus at wildside.dk
Wed Aug 10 21:10:26 CEST 2011


That should also work although it changes logic a bit.

If all else fails you can add the referrer as arguments in URL and define those as optional arguments for the controller action you choose - then, you could use both forward() and redirect() based on those values. But, using originalRequest is preferred, definitely.

Claus

On Aug 10, 2011, at 8:45 PM, math5005 at gmx.de wrote:

>> 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. 
> _______________________________________________
> 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