I have this route:
Router::connect(
'/:controller/*',
array('controller'=>'con3'),
array('controller'=>'con1|con2')
);
I am trying to direct every call to
/con1/x1/x2
to
/con3/x1/x2
and
/con2/y1/y2
to
/con3/y1/y2
it is not working, why ?
If you require to route
/con3/to/con1/and/or/con2/based on your own constraints what you require is a CustomRoute class. For this there is no better place than Mark Story’s tutorial on customRouteclasses.Otherwise, you could of course just extend your controllers (and leave the body empty) like this:
In this case you don’t need to mess with connecting routes like you are right now. Object inheritance will take care of your “aliasing” for you.