In my custom module, ed_helper, I have this ed_helper.routing.yml:
ed_helper.my_page:
path: '/mypage/page'
defaults:
_controller: '\Drupal\ed_helper\Controller\EdHelperController::myPage'
_title: 'My first page in D8'
requirements:
_permission: 'access content'
In ed_helper/src/Controller, I have this EdHelperController.php:
<?php
namespace Drupal\ed_helper\Controller;
use Drupal\Core\Controller\ControllerBase;
/**
* Utility pages.
*/
class EdHelperController extends ControllerBase {
/**
* Returns a simple page.
*
* @return array
* A simple renderable array.
*/
public function myPage() {
return [
'#markup' => 'Hello, world',
];
}
}
I have confirmed that the module is installed, and I cleared the cache, but am still getting "Page not found" at /mypage/page. What am I missing?
I tried switching the theme to Claro, but I still get "page not found" at my custom route. I also tried uninstalling ed_helper and re-installing it.
My Drupal version is 10.1.