1
votes

I have a plugin named Manager. I want to map route on /login to the index action of Dashboard Controller on plugin. Something like this:

Router::connect('/login', array('controller' => 'dashboard', 'action' => 'index', 'plugin => 'manager'));

How can I achieve this on Cakephp 2.2?

thanks

2
My example worked for me... I don't know why it's not working while ago... sorry!rizidoro

2 Answers

4
votes

Once a plugin has been installed in /app/Plugin, you can access it at the URL /plugin_name/controller_name/action. In your Manager plugin example, you'd access DashboardController at /manager/dashboard.

Have you tries using Plugin Syntax, like:

Router::connect('/login', 
    array('controller' => 'Manager.dashboard', 'action' => 'index')
);

Using the 'plugin' key in the $options array should also do the job:

Router::connect('/login', 
    array('plugin' => 'manager','controller' => 'dashboard', 'action' => 'index')
);
0
votes

If use plugin like 'users plugin' try in plugin's routes file (routes.php)