Having some issues with the URL routing for my Users plugin and I can't seem to understand what is causing the issues.
So, I have baked a plugin using the cake shell (cake bake plugin Users). This has created the folder structure in plugins folder (./plugins/Users/).
I have also created the bare minimum in UsersController.php(./plugins/Users/src/Controller/UsersController.php)
<?php
namespace Users\Controller;
use Users\Controller\AppController;
class UsersController extends AppController {
public function login() {
}
}
My routes.php file looks like this:
Router::plugin('Users', function ($routes) {
$routes->connect('/login', [
'controller' => 'Users',
'action' => 'login'
], ['_name' => 'login']);
$routes->fallbacks();
});
Accessing www.examples.com/users/login I receive :
"Error: Create the class UsersController below in file: /var/www/plugins/Users/src/Controller/UsersController.php"
DebugKit error shows:
Unserializable object - Cake\Routing\Exception\MissingControllerException. Error: Controller class Users could not be found. in /var/www/vendor/cakephp/cakephp/src/Routing/Dispatcher.php, line 80
I have been toying with this for almost a day now, including consulting the CakePHP Book so any help would be appreciated if I am missing one small thing