O'Reilly logo

Drupal 8 Module Development by Daniel Sipos

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The route

Inside our module, we will need to create our routing file that will hold all our statically defined routes. The name of this file will be hello_world.routing.yml. By now, I assume that you understand what the deal is with the file naming conventions in a Drupal 8 module. However, in any case, this is another YAML file in which we will need to put the YAML formatted data:

hello_world.hello:  path: '/hello'  defaults:    _controller: '\Drupal\hello_world\Controller\HelloWorldController::helloWorld'    _title: 'Our first route'  requirements:    _permission: 'access content'

This is our first route definition. It starts with the route name (hello_world.hello) followed by all the necessary info about it, below, in a YAML formatted multidimensional ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required