mvc • php.Twig (based on Symfony) - martindubenet/wed-dev-design GitHub Wiki

Conditional example

  1. {{ alertHeadingClass|default('h3') }}
  2. {% if listItems is defined and not null %}
    <div class="row">
        <div class="col">
            <h3 class="{{ alertHeadingClass|default('h3') }}">{{ alertHeadingTitle|default('Alert heading title') }}</h3>
            <p>
                {{ alertParagraphText|default('200 bytes lôrem ïpsum dolor sit àmet, consectetur adipiscing elit. Nam nec pretium nulla. Étiam sollicitudin, turpis ac rhoncus fermentum, ante justo iaculis ïpsum, ac elementum Ôdio arcu nec posueres') }}
            </p>
            {% if listItems is defined and not null %}
                <ul>
                    {% for listItem in listItems %}
                        <li>{{ listItem.item }}</li>
                    {% endfor %}
                </ul>
            {% endif %}
        </div>
        <div class="col">
            {% include 'atoms-link-element' with { text: 'CTA link element' } %}
        </div>
    </div>
⚠️ **GitHub.com Fallback** ⚠️