Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 1.33 KB

File metadata and controls

36 lines (27 loc) · 1.33 KB

Routing

To remove the second users from /users/users in the url you can use routes.

The plugin itself comes with a routes file but you need to explicitly load them.

CakePlugin::load('Users', array(
	'routes' => true
));

List of the used routes:

Router::connect('/users', array('plugin' => 'users', 'controller' => 'users'));
Router::connect('/users/index/*', array('plugin' => 'users', 'controller' => 'users'));
Router::connect('/users/:action/*', array('plugin' => 'users', 'controller' => 'users'));
Router::connect('/users/users/:action/*', array('plugin' => 'users', 'controller' => 'users'));
Router::connect('/login/*', array('plugin' => 'users', 'controller' => 'users', 'action' => 'login'));
Router::connect('/logout/*', array('plugin' => 'users', 'controller' => 'users', 'action' => 'logout'));
Router::connect('/register/*', array('plugin' => 'users', 'controller' => 'users', 'action' => 'add'));

Changing the routes

If you're extending the plugin remove the plugin from the route by setting it to null and replace the controller with your controller extending the plugins users controller.

Router::connect('/users', array('plugin' => null, 'controller' => 'app_users'));
/* ... */

Feel free to change the routes here or add others as you need for your application.