I have several models which are extensions of User. For each type,
I've set up a routing scheme such that
(for controllers, "controller1", "controller2", "controller3", "controller4")
/controllerX/some_slug
... will take me to the view action, passing the slug, for that controller.
Router::connect('/controller1/:user_slug',
array('controller' => 'controller1', 'action' => 'view'),
array(
'user_slug' => '[\+\-_A-Za-z]+',
'pass' => array('user_slug')
)
);
$link = $html->link(
$controller1['Model1']['label'],
array(
'controller' => 'controller1',
'action' => 'view',
'user_slug' => $controller1['Model1']['slug']
)
);
Now, because I have several of these, I thought I might be able to get
away with the following:
Router::connect('/:controller_name/:user_slug',
array('controller' => ':controller_name', 'action' => 'view'),
array(
'controller_name' =>
'[controller1|controller2|controller3|controller4]',
'user_slug' => '[\+\-_A-Za-z]+',
'pass' => array('user_slug')
)
);
$link = $html->link(
$controller1['Model1']['label'],
array(
'controller_name' => 'controller1',
'action' => 'view',
'user_slug' => $controller1['Model1']['slug']
)
);
But that produces URLs along these lines:
/controller1/view/controller_name:controller1/user_slug:some_slug
Is it possible to do what I'm trying to do?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---