help_topics_test.test_urls.html.twig

Same filename in other branches
  1. 9 core/modules/help_topics/tests/modules/help_topics_test/help_topics/help_topics_test.test_urls.html.twig
  2. 11.x core/modules/help/tests/modules/help_topics_test/help_topics/help_topics_test.test_urls.html.twig
---
label: 'URL test topic'
top_level: true
---
{% set non_route_link = render_var(help_route_link('not a route', 'not_a_real_route')) %}
{% set missing_params_link = render_var(help_route_link('missing params', 'help_topics_test.test_route')) %}
{% set invalid_params_link = render_var(help_route_link('invalid params', 'help_topics_test.test_route', {'int_param': 'not_an_int'})) %}
{% set valid_link = render_var(help_route_link('valid link', 'help_topics_test.test_route', {'int_param': 2})) %}
{% set topic_link = render_var(help_topic_link('help_topics_test.additional')) %}
{% set not_a_topic = render_var(help_topic_link('not_a_topic')) %}
<p>{% trans %}This topic should be top-level. It is used to test URLs{% endtrans %}</p>
<ul>
  <li>{% trans %}Should not be a link: {{ non_route_link }}{% endtrans %}</li>
  <li>{% trans %}Should not be a link: {{ missing_params_link }}{% endtrans %}</li>
  <li>{% trans %}Should not be a link: {{ invalid_params_link }}{% endtrans %}</li>
  <li>{% trans %}Should be a link if user has access: {{ valid_link }}{% endtrans %}</li>
  <li>{% trans %}Should be a link: {{ topic_link }}{% endtrans %}</li>
  <li>{% trans %}Should not be a link: {{ not_a_topic }}{% endtrans %}</li>
</ul>

File

core/modules/help/tests/modules/help_topics_test/help_topics/help_topics_test.test_urls.html.twig

View source
  1. ---
  2. label: 'URL test topic'
  3. top_level: true
  4. ---
  5. {% set non_route_link = render_var(help_route_link('not a route', 'not_a_real_route')) %}
  6. {% set missing_params_link = render_var(help_route_link('missing params', 'help_topics_test.test_route')) %}
  7. {% set invalid_params_link = render_var(help_route_link('invalid params', 'help_topics_test.test_route', {'int_param': 'not_an_int'})) %}
  8. {% set valid_link = render_var(help_route_link('valid link', 'help_topics_test.test_route', {'int_param': 2})) %}
  9. {% set topic_link = render_var(help_topic_link('help_topics_test.additional')) %}
  10. {% set not_a_topic = render_var(help_topic_link('not_a_topic')) %}
  11. <p>{% trans %}This topic should be top-level. It is used to test URLs{% endtrans %}</p>
  12. <ul>
  13. <li>{% trans %}Should not be a link: {{ non_route_link }}{% endtrans %}</li>
  14. <li>{% trans %}Should not be a link: {{ missing_params_link }}{% endtrans %}</li>
  15. <li>{% trans %}Should not be a link: {{ invalid_params_link }}{% endtrans %}</li>
  16. <li>{% trans %}Should be a link if user has access: {{ valid_link }}{% endtrans %}</li>
  17. <li>{% trans %}Should be a link: {{ topic_link }}{% endtrans %}</li>
  18. <li>{% trans %}Should not be a link: {{ not_a_topic }}{% endtrans %}</li>
  19. </ul>

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