0
votes

i want make separate admin login but not working giving me error for below url

sitename/admin/admin_login

Error:

Error: AdminLoginController could not be found.

Error: Create the class AdminLoginController below in file: app/Controller/AdminLoginController.php

Cake Php routing setting mention below

app\Plugin\Usermgmt\Config\routes.php

Router::connect('/login', array('plugin' => 'usermgmt', 'controller' => 'users', 'action' => 'login')); // working fine
Router::connect('/admin_login', array('admin' => true, 'plugin' => 'usermgmt', 'controller' => 'users', 'action' => 'admin_login')); // not working

app\Config\routes.php

Configure::write('Routing.prefixes', array('admin'));

app\Plugin\Usermgmt\Controller\UsersController.php(action in controller)

public function admin_login() {
// here is admin login code
}

My view file path app\Plugin\Usermgmt\View\Users\admin_login.ctp

1

1 Answers

0
votes

Your route is set up for /admin_login, NOT /admin/admin_login, like the URL you say you're trying.

Just change your URL to sitename/admin_login and it should work.