Wednesday 24 June 2015

Add prefix to urls in CakePHP

CakePHP has power to do a lot with conventions by using routes. It’s 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));


- See more at: http://findnerd.com/list/view/Add-prefix-to-urls-in-CakePHP/3553/


For queries about PHP Programming Questions and Answers

You can Visit to: PHP Developer Forum    

No comments:

Post a Comment