Drupal Twig VarDumper Module

Dump Beispiel mit dem Twig VarDumper Contrib-Modul.
 

{% set price = package.get('field_price').value %}
{% set dossier = payment.getDossier() %}

{{ dump(user.account.roles|last) }}
{{ dump(package.field_ref_role.target_id) }}
{{ dump() }}

{% set price_type = price > 0 ? package.get('field_price_type').get(0)|list_integer_string|t : '' %}
{% set lifetime = package.get('field_lifetime_type').get(0)|list_integer_string|t %}
        {% if invite_form %}
          <h2>{{ 'Lorem ipsum dolor sit amet'|t }}</h2>
        {% else %}
          {% if user.account.roles|last != package.field_ref_role.target_id %}
          {% if package.get('title').value == "Select 30" %}
            <h2>{{ 'Lorem ipsum dolor sit amet @tarif tariff (@price EURO; duration @lifetime)'|t({
                '@tarif': package.get('title').value,
                '@price': price|format_price(''),
                '@separator': price > 0 ? ' ' : ' ',
                '@lifetime': lifetime
              }) }}</h2>
          {% else %}
            <h2>{{ 'Lorem ipsum dolor sit amet@tarif tariff (@price EURO@separator@price_type; duration @lifetime)'|t({
                '@tarif': package.get('title').value,
                '@price': price|format_price(''),
                '@separator': price > 0 ? ' ' : ' ',
                '@price_type': 'pro Monat',
                '@lifetime': lifetime
              }) }}</h2>
          {% endif %}
          {% endif %}
          {% if dossier %}
            <h2>{{ 'Selected dossier "@dossier" (@price EURO)'|t({
                '@dossier': dossier.label(),
                '@price': payment.getAmountDossierRaw()|format_price('')
              }) }}</h2>
          {% endif %}
        {% endif %}

{{ package.get('field_notice_ext').value|raw }}

 

Tags