[symfony-users] Re: Put message from forward404() into template

2009-09-15 Thread rooster (Russ)
On Sep 15, 6:34 am, Casey casey.cam...@gmail.com wrote: I haven't tried this, but since it is a forward, can you set a request attribute that can be accessed by the 404 action? That's pretty much what I was getting at! The problem is still that you'd have to set it before calling one of the

[symfony-users] Re: Put message from forward404() into template

2009-09-15 Thread Davide Borsatto
I think a flash message for the user object would do the job --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe

[symfony-users] Re: Put message from forward404() into template

2009-09-15 Thread Casey
To automate the process you could make a myactions.class.php file in the lib dir that extends sfActions then change all of the actions under your modules folder to inherit from myactions. Then create a forward404WithMessage($msg) function that automatically sets the msg as an attribute, say

[symfony-users] Re: Put message from forward404() into template

2009-09-14 Thread Lee Bolding
On 13 Sep 2009, at 18:12, rooster (Russ) wrote: In the meantime, unless anyone else can think of something, the only thing I can suggest is that you override the sf404Exception class to store the message for you. I haven't tried this before, but you could try using my sfRequestPlugin

[symfony-users] Re: Put message from forward404() into template

2009-09-14 Thread rooster (Russ)
Well, since the request is forwarded and not redirected it is possible to set any number of different variables that can be retrieved later, even something like sfConfig::set(404_message, something); would be sufficient. The problem is that you'd have to do that prior to calling 404 function, so

[symfony-users] Re: Put message from forward404() into template

2009-09-14 Thread Casey
I haven't tried this, but since it is a forward, can you set a request attribute that can be accessed by the 404 action? On Sep 14, 5:49 am, rooster (Russ) russmon...@gmail.com wrote: Well, since the request is forwarded and not redirected it is possible to set any number of different

[symfony-users] Re: Put message from forward404() into template

2009-09-13 Thread rooster (Russ)
On Sep 13, 9:05 am, pcummins patwcumm...@gmail.com wrote: How do I get the message from a call to $this-forward404() into a customized error404Success.php template? Your custom template should have a variable called $exception, which is the sfError404Exception object... The message is the

[symfony-users] Re: Put message from forward404() into template

2009-09-13 Thread Patrick Cummins
Russ, unfortunately the $exception variable doesn't seem to available when I send a 404 (see code below). The $exception variable IS available when I throw an unhandled exception from an action. Unfortunately, my entire app was built to throw errors (for missing parameters and just about

[symfony-users] Re: Put message from forward404() into template

2009-09-13 Thread rooster (Russ)
Sorry, my bad - on closer inspection this is not the case for 404 exceptions. Not sure why, this would be a useful feature! The only place that gets the error message is the php error_log function, which means in theory you could retrieve the error using error_get_last(). This is not wise

[symfony-users] Re: Put message from forward404() into template

2009-09-13 Thread Patrick Cummins
Thanks Russ! I looked into converting all 404's errors to unhandled exceptions... but error.html.php, doesn't get decorated with the layout so I'll take a crack overriding the sf404Exception. I'll post my patch when it's done. On Sun, Sep 13, 2009 at 1:12 PM, rooster (Russ)