I have been working with CakePHP for sometime and for some reason today i started getting the Missing Controller Exception - Error: BlogController could not be found. while trying to access a /blog route.
I have created the blog.ctp file inside of the Pages directory.
And this is my route code
$routes->connect('/blog', ['controller' => 'Pages', 'action' => 'blog'], ['routeClass' => 'DashedRoute']);
And inside my PagesController.php i have created the blog function as well.
public function blog()
{
$this->viewBuilder()->setlayout('frontend');
}
Am i doing something wrong here? Is it a bug in the version of CakePHP I'm using? Because i have never gotten this error earlier.
I'm using CakePHP - 3.7.4.