Hi all
I was wanting to know if it is by design that the $params argument is
immutable in Dispatcher::_invoke()?

I'm working on a SEF solution where I'd like to do the slug translation in
the beforeFilter of my App Controller, and then set $this->params['pass'][0]
to be the id of my translated slug.

However, because _invoke is defined as _invoke(&$controller, $params), any
changes in beforeFilter to $this->params never make it back into _invoke to
be passed to $controller->dispatchMethod();

By changing the _invoke to be _invoke(&controller, &$params), I can play
with param values in the beforeFilter, and have them passed through to the
action.

Looking at the assignment of the Dispatcher param to the controller in
Dispatcher::dispatch() (Line 169: dispatcher.php for Cake 1.2.2.8120 :
 $controller->params
=& $this->params;), it looks as though there might have been an original
intention to have any changed params in the controller reflected through to
the dispatcher version, and vis versa.

Just wondering if anyone has any informed feedback on this, and if it would
be worth putting a Trac ticket through for it.

The downside of the current method is that I have to resolve the slug twice.
 Once for the beforeFilter of the App Controller, and again on the actual
action being called.

Regards
Reuben Helms

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to