my-cta.twig

Same filename and directory in other branches
  1. 11.x core/modules/system/tests/modules/sdc_test/components/my-cta/my-cta.twig
{% if target is not empty %}
  {% set attributes = attributes.setAttribute('target', target) %}
{% endif %}
<a {{ attributes }} href="{{ href }}">
  {{ text }}
</a>

File

core/modules/system/tests/modules/sdc_test/components/my-cta/my-cta.twig

View source
  1. {% if target is not empty %}
  2. {% set attributes = attributes.setAttribute('target', target) %}
  3. {% endif %}
  4. <a {{ attributes }} href="{{ href }}">
  5. {{ text }}
  6. </a>

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.