CakePHP plugin: None of the currently connected routes match the provided parameters

If you want your plugin to have and use routes, you need to configure it first – otherwise, None of the currently connected routes match the provided parameters. Add a matching route to config/routes.php Start by enabling routes and bootstrapping when you load the plugin in your src/Application.php: $this->addPlugin(‘MyPlugin’, [‘bootstrap’ => true, ‘routes’ => true]);… Continue reading CakePHP plugin: None of the currently connected routes match the provided parameters

Working with HTTP request type (method) in CakePHP

Get the request type (method): $this->request->getMethod() (For the older versions before 3.4, use $this->request->method()) Check the request type (method): $this->request->is('post'); Documentation: https://book.cakephp.org/4/en/controllers/request-response.html#reading-the-http-method https://book.cakephp.org/4/en/controllers/request-response.html#Cake\Http\ServerRequest::is