CakePHP has power to do a lot with conventions by using routes. Its additionally possible to utilize custom prefixes adjacent to your admin routes for extra flexibility. Prefix routing can be enabled from within the core configuration file by setting the prefixes with Routing.prefixes.
Configure::write('Routing.prefixes', array('admin'));
We can create our prefix route as follows:
Router::connect('/employer/:controller/:action/*', array('prefix' => 'employer', 'employer' => true));
Creating links to your prefixed actions:
echo $html->link('Edit employer', array('controller' => 'users', 'action' => 'edit', 'employer' => true, 1));
This will create link as : /employer/users/edit/1
0 Comment(s)