twig_theme_test.url_generator.html.twig

Same filename in other branches
  1. 9 core/modules/system/tests/modules/twig_theme_test/templates/twig_theme_test.url_generator.html.twig
  2. 10 core/modules/system/tests/modules/twig_theme_test/templates/twig_theme_test.url_generator.html.twig
  3. 11.x core/modules/system/tests/modules/twig_theme_test/templates/twig_theme_test.url_generator.html.twig
{# Test the url and path twig functions #}
<div>path (as route) not absolute: {{ path('user.register') }}</div>
<div>url (as route) absolute: {{ url('user.register') }}</div>

<div>path (as route) not absolute with fragment: {{ path('user.register', {}, {'fragment': 'bottom' }) }}</div>
<div>url (as route) absolute despite option: {{ url('user.register', {}, {'absolute': false }) }}</div>
<div>url (as route) absolute with fragment: {{ url('user.register', {}, {'fragment': 'bottom' }) }}</div>

File

core/modules/system/tests/modules/twig_theme_test/templates/twig_theme_test.url_generator.html.twig

View source
  1. {# Test the url and path twig functions #}
  2. <div>path (as route) not absolute: {{ path('user.register') }}</div>
  3. <div>url (as route) absolute: {{ url('user.register') }}</div>
  4. <div>path (as route) not absolute with fragment: {{ path('user.register', {}, {'fragment': 'bottom' }) }}</div>
  5. <div>url (as route) absolute despite option: {{ url('user.register', {}, {'absolute': false }) }}</div>
  6. <div>url (as route) absolute with fragment: {{ url('user.register', {}, {'fragment': 'bottom' }) }}</div>

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