Re: [fw-general] _forward() question

2008-02-14 Thread Simon R Jones
thanks for the reply Matthew Can I ask why _forward() stacks and only forwards at the end of the current controller method? I couldn't find any reference to why it works this way in the docs so when some of the guys in the office had used multiple forwards (without returns) the default

Re: [fw-general] _forward() question

2008-02-14 Thread Kamil Nowakowski
Simon R Jones pisze: thanks for the reply Matthew Can I ask why _forward() stacks and only forwards at the end of the current controller method? I couldn't find any reference to why it works this way in the docs so when some of the guys in the office had used multiple forwards (without

Re: [fw-general] _forward() question

2008-02-14 Thread Matthew Weier O'Phinney
-- Simon R Jones [EMAIL PROTECTED] wrote (on Thursday, 14 February 2008, 09:05 AM +): thanks for the reply Matthew Can I ask why _forward() stacks and only forwards at the end of the current controller method? I couldn't find any reference to why it works this way in the docs so when

[fw-general] _forward() question

2008-02-13 Thread Simon R Jones
hi there, I'm using $this-_forward() in a controller method to forward the request onto a login page, this can't be done that easily in pre- dispatch since different methods have different requirements for ACL and we have a rather complex custom route system going on (part of which

Re: [fw-general] _forward() question

2008-02-13 Thread Matthew Weier O'Phinney
-- Simon R Jones [EMAIL PROTECTED] wrote (on Wednesday, 13 February 2008, 05:14 PM +): I'm using $this-_forward() in a controller method to forward the request onto a login page, this can't be done that easily in pre-dispatch since different methods have different requirements for ACL and

Re: [fw-general] _forward() Question

2007-05-05 Thread Todd Wolaver
The _forward() method is marked final in Zend_Controller_Action public function indexAction() { if($this-_getParam('validComponent') !== true) throw new Exception('Can not find page.'); edit processing

Re: [fw-general] _forward() Question

2007-05-05 Thread Todd Wolaver
Sorry about that last post... premature sending The _forward() method is marked final in Zend_Controller_Action so I can't add an attribute by extending the class. This is what I've ended up doing, where validComponent is added to the params passed to the _forward() method. public

Re: [fw-general] _forward() Question

2007-05-05 Thread Maurice Fonk
Interesting. I wonder why the method is marked final? It seems to me like extending it might come in useful, because in your case you have to perform additional steps (adding validComponent to the params) as well. MF Todd Wolaver wrote: Sorry about that last post... premature sending The

Re: [fw-general] _forward() Question

2007-05-05 Thread Matthew Weier O'Phinney
-- Maurice Fonk [EMAIL PROTECTED] wrote (on Saturday, 05 May 2007, 03:57 PM +0200): Interesting. I wonder why the method is marked final? It seems to me like extending it might come in useful, because in your case you have to perform additional steps (adding validComponent to the params) as

Re: [fw-general] _forward() Question

2007-05-05 Thread Maurice Fonk
Indeed, that makes perfect sense. Enforcing compatibility between modules does sound kind of important ;). Still, having to add aditional parameters to the request, or checking whether the action name is in the path info feels like a bit of a hack to me. Furthermore, if I have an index

Re: [fw-general] _forward() Question

2007-05-05 Thread Matthew Weier O'Phinney
-- Todd Wolaver [EMAIL PROTECTED] wrote (on Saturday, 05 May 2007, 12:24 PM -0500): I agree that there should be a standard way to check for forwards or what actions have already been called. Possibly keeping track of this in the Front controller? Feel free to create a proposal. :-) As

Re: [fw-general] _forward() Question

2007-05-05 Thread Maurice Fonk
You are right. That's what you get for thinking out loud, you can be wrong, I don't quote Socrates for nothing ;). You can't use attributes of the object (controller instance) that does the forwarding to keep track of the forwarding process. In one of your controllers, try the following (also

Re: [fw-general] _forward() Question

2007-05-05 Thread Matthew Weier O'Phinney
-- Maurice Fonk [EMAIL PROTECTED] wrote (on Saturday, 05 May 2007, 08:03 PM +0200): You are right. That's what you get for thinking out loud, you can be wrong, I don't quote Socrates for nothing ;). You can't use attributes of the object (controller instance) that does the forwarding to keep

Re: [fw-general] _forward() Question

2007-05-05 Thread Ramon de la Fuente
Hi All, Then why not just set a variable in the Registry? Or am I overlooking something? Regards, Ramon Maurice Fonk wrote: You are right. That's what you get for thinking out loud, you can be wrong, I don't quote Socrates for nothing ;). You can't use attributes of the object

Re: [fw-general] _forward() Question

2007-05-05 Thread Maurice Fonk
That looks like an elegant solution. There's one little thing though. You only check for a matching action name to see if it has been forwarded, but what if I forward to another controller, but an action with the same name? Other than that it looks just fine. Matthew Weier O'Phinney wrote:

Re: [fw-general] _forward() Question

2007-05-05 Thread Matthew Weier O'Phinney
-- Maurice Fonk [EMAIL PROTECTED] wrote (on Saturday, 05 May 2007, 10:19 PM +0200): That looks like an elegant solution. There's one little thing though. You only check for a matching action name to see if it has been forwarded, but what if I forward to another controller, but an action

Re: [fw-general] _forward() Question

2007-05-05 Thread Maurice Fonk
I gathered as much ;), just wanted to point it out to save some poor souls some headaches. In any case, thank you a lot for your help, this will come in quite handy for me and probably others. For these kind of questions/problems the mailing list and it's archives are an invaluable resource