Skip to content
Snippets Groups Projects
  1. Mar 20, 2019
  2. Apr 13, 2018
  3. Jul 18, 2017
    • Jaime Pérez Crespo's avatar
      Add a TemplateControllerInterface. · 20da7652
      Jaime Pérez Crespo authored
      This new interface allows themes to define a class that can be hooked at certain specific points of template initialization/handling, so that they can do stuff like automatically adding variables for all templates, or adding twig extensions. This classes must implement the new TemplateControllerInterface, and be specified in the "theme.controller" configuration option. This way, we avoid the performance hit if we use traditional hooks, and we also avoid hooks from other modules causing trouble.
      
      For now, the interface offers two entry points: setUpTwig(), which allows managing the twig environment after initialization (e.g. to add an extension or define filters); and display(), which offers all the data passed to the template, and allows adding or modifying it.
      20da7652
Loading