[Drupal] Base hook schema example to put in .install

Introduction Delighted hook_schema is one of those methods where you are happy to have a usable documentation on the api website. It is pretty much self-explanatory and you don’t have to look for hours on third parties websites to get some usable information. 🙂 hook_schema on api.drupal.org and don’t forget to select your Drupal version! […]

[Drupal] Table render array example structure

Result The code

Additional Information Tested to work on Drupal 8.2.x. For some reason, no_striping doesn’t work as expected in 8.2.x (it is ignored). The script which handles the render array conversion to twig ready variables is located here: core\includes\theme.inc. The twig template which renders the table on the default theme is here: core\themes\classy\templates\dataset\table.html.twig.

[Drupal] Create an event subscriber

Instructions I will be creating a dedicated module using Drupal Console for this event subscriber. But feel free to use your own if you already have one! (don’t forget to backup) Access the drupal root folder in command line. Generate a new module:

Generate the event subscriber. We will subscribe to the kernel.request event: […]

[Drupal] Service dependency injection in a service type class

The code

Additional Information Declare the services your class will use in the .services.yml file of your module. Unlike plugin type class service dependency injection, there is no create method to define the needed services. The __construct signature needs to respect the declared arguments from the .services.yml file. Originally made and tested on […]

Mini point sur ma carrière

J’ai quittĂ© volontiers l’industrie du jeu vidĂ©o, ayant perdu toute motivation d’y travailler. L’entreprise dans laquelle j’avais passĂ© plus de quatre ans Ă  essayer de produire des jeux et des applications est sur le point de fermer dĂ©finitivement. Un chapitre de ma vie est en train de se clore, j’imagine. Avais-je dit que j’Ă©tais rentrĂ© […]