Palette - Make it Colorful🎨
Palette - Visual Page Builder, no design degree required.
Scroll
Drupal Create page programmatically
22/02/2025, by Anonymous (not verified)
Forums
- Log in to post comments
Routing YAML file for the Example module
The routing information is stored in
example/example.routing.yml:module_name.sub_name. When other parts of the code need to refer to the route, they will use the machine name./).Page implementation for the Example module
The Controller class
ExampleControllershould be defined inexample/src/Controller/ExampleController.php:\Drupal\example\Controller\ExampleController, it should look for the filemodules/example/src/Controller/ExampleController.php.ControllerBaseinstead of the fully qualified name. This makes ourclassline much easier to read.Drupal API documentation:
https://www.drupal.org/docs/8/creating-custom-modules/create-a-custom-page