LABS05 | Building a Drupal 8 Module

  • The Drupal 8 content management system now uses some Symfony core components for its underlying architecture as well as Twig for its templating engine. This revolution in the design of Drupal 8 makes it possible for a developper to learn the Symfony best practices and core concepts in order to reuse them in the context of a Drupal 8 module. In this workshop, you'll learn how to build you first dynamic Drupal 8 module and leverage the power of some Symfony core components.
  • Prerequisites

    Basic knowledge of object oriented programming with PHP
  • Goals

    This training helps you discover the new architecture of Drupal 8 and guide you into the development of your very first Drupal 8 module. You'll first learn how to bootstrap, configure and enable a new Drupal 8 module. Then, you'll discover how to map HTTP URLs to your Drupal 8 module controllers and render some Twig templates to generate dynamic web pages. You'll also learn how to leverage the power of the Symfony dependency injection component refactor and decouple your business logic into domain specific services. Finally, this training will show you how to dynamically extend some Drupal internals thanks to the configuration system and new hooking system with the Symfony event dispatcher component.

Full program

Getting Started with Drupal 8 Module Development

  • Bootstrapping and enabling a simple Drupal 8 module
  • Understanding the directory structure of a Drupal 8 module
  • Mastering the configuration files of a Drupal 8 module
  • Registering new routes in the Drupal 8 module
  • Mapping HTTP URLs to a Drupal 8 controllers
  • Converting a Request object into a Response object
  • Rendering a Twig template from a controller

Discovering the Dependency Injection Principles

  • Understanding the dependency injection principles
  • The different types of objects injection
  • Understanding how dependency injection is handled by Symfony
  • Understanding the purposes of the Symfony dependency injection container
  • Discovering the Drupal 8 built-in services
  • Registering new services into the container
  • Replacing an existing Drupal 8 service with another custom one

Event Driven Programming with the EventDispatcher Component

  • Discovering the « Observer » and « Mediator » design patterns
  • Decoupling application code with an event driven programming approach
  • Identifying Symfony and Drupal built-in events
  • Connecting custom event listeners to Symfony & Drupal 8 events
  • Dispatching custom events to decouple code
  • Creating custom event objects
  • Registering event « listeners » and « subscribers »

Time program

Day 1

Appreciation of the training

Global average :

  1. Educational rating : N.C
  2. Content rating : N.C
  3. Pace rating : N.C
  • Duration

    1 day(s)
  • Level

    Beginner
  • Available languages

    French
  • Available countries

    France
From €690.00
No session scheduled

No session is scheduled for this course. However we organize tailored training courses: contact us for more informations!