When I was new to cakephp 3.0 then I faced issue adding admin prefix. In Cakephp 2.* it was simple, just write the following lines in core.php:
Configure::write('Routing.prefixes', array('admin'));
To enable cakephp 3.0 just write the following code in app/config/routes.php
Router::prefix('admin', function($routes) {
$routes->connect('/', ['controller'=>'Users','action'=>'login']);
$routes->fallbacks('InflectedRoute');
});
Now make Admin folder inside Controller src: src/Controller/Admin/UsersController.php
Add following lines of code in UsersController.php
namespace App\Controller\Wcbadmin;
Now make the view file: src/Template/Admin/Users/login.ctp
Its all done!
0 Comment(s)