I'm trying to create a new module with a routing file pointing to a controller. But i get the following error in my logs
ReflectionException: Class \Drupal\glue\Controller\GlueController does not exist in ReflectionMethod->__construct() (line 128 of /home/vagrant/Projects/neut-business-website/core/lib/Drupal/Core/Entity/EntityResolverManager.php).
glue.routing.yml:
hello_world:
path: '/hello-world'
defaults:
_controller: '\Drupal\glue\Controller\GlueController::helloWorldPage'
requirements:
_permission: 'access content'
With following controller
project_folder/modules/glue/src/Controller/GlueController
<?php
namespace Drupal\glue\Controller;
class GlueController {
public function hellowWorldPage() {
return [
'#markup' => t('<p>Hello world</p>')
];
}
}