You cant pass properties, and not use them in the router, and then expect it to find them magically. The router parses the current URL in the address bar and uses those values to pass into the action, unless you have defined a route that matches and has static properties. You either need to rethink your strategy, or use URL slugs.
On Jan 19, 12:56 am, jordicakephp <[email protected]> wrote: > Good morning, > > I'm trying to implement the reverse routing capability to my app > through the following two instructions. > > In my view: > > echo $html->link( > $province[0], > array('controller' => 'users', > 'action' => 'directory', > 'es-es', > '0', > 'province' => $province[1])); > > In my routes.php: > > Router::connect('/empresas/:province', > array('controller' => 'users', 'action' => 'directory', > 'es-es', '0'), > array('pass' => array('province'))); > > This outputs the link /empresas/barcelona, as I expect and want, but > my method directory($language = null, $searchBy = null, $item = null) > receives the params 'barcelona', 'es-es' and '0'. However, I expect it > to receive 'es-es', '0' and 'barcelona'; what is worse: I am not able > to reorder the way in which those params are passed to my controller's > action. > > My doubts: > > 1. How can I tell Cake "generate the link /empresas/barcelona and pass > behind the scenes 'es-es', '0', 'barcelona' to directory. > > 2. Could anyone please explain me why my method receives those params > in that order? > > God bless you.
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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
