drupal-module avb_twig
Drupal 8 Twig Extension. Provides custom twig functions and filters.
avblink/avb_twig
Drupal 8 Twig Extension. Provides custom twig functions and filters.
- Friday, April 28, 2017
- by avblink
- Repository
- 1 Watchers
- 0 Stars
- 605 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 2 Versions
- 5 % Grown
Drupal Twig Extension by AVB Link
Contains Drupal Twig functions and filters., (*1)
- Get current entity from path.
{% set node = avb_twig_current_entity('node') %}
- Assign new Attribute() class to a variable
{% set attributes = avb_twig_create_attribute(['class', ['class1', 'class2']]) %}
{{ avb_twig_create_attribute().addClass(['class1', 'class2'])}}
{% set attributes = avb_twig_create_attribute().addStyle({'background-color': 'red'}) %}