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 also Visit to PHP Developer Forum

Advertisements
Add prefix to urls in CakePHP

3 thoughts on “Add prefix to urls in CakePHP

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s