You are here

twig_theme_test.url_generator.html.twig in Drupal 10

{# 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>