Tutorial by Examples

Contrary to Drupal 7 you cannot call regular PHP functions in your templates. In Drupal 8 the way to go is by creating filters and functions. You should use a filter when: you want to transform the data you want to display. Imagine you have a title that you want to always be uppercase. For example,...
This example will show you how to use Dependency Inject to use other services registered in the Drupal environment. Imagine you have an SVG image file that changes colors depending on some random CSS/Javascript thing in your project. To be able to target the SVG with CSS you have to actually have t...

Page 1 of 1