description.html.twig

Same filename in this branch
  1. 4.0.x modules/menu_example/templates/description.html.twig
  2. 4.0.x modules/form_api_example/templates/description.html.twig
  3. 4.0.x modules/js_example/templates/description.html.twig
  4. 4.0.x modules/page_example/templates/description.html.twig
  5. 4.0.x modules/node_type_example/templates/description.html.twig
  6. 4.0.x modules/pager_example/templates/description.html.twig
  7. 4.0.x modules/block_example/templates/description.html.twig
  8. 4.0.x modules/tabledrag_example/templates/description.html.twig
  9. 4.0.x modules/rest_example/templates/description.html.twig
  10. 4.0.x modules/testing_example/templates/description.html.twig
  11. 4.0.x modules/tour_example/templates/description.html.twig
  12. 4.0.x modules/config_entity_example/templates/description.html.twig
  13. 4.0.x modules/phpunit_example/templates/description.html.twig
  14. 4.0.x modules/render_example/templates/description.html.twig
  15. 4.0.x modules/field_permission_example/templates/description.html.twig
  16. 4.0.x modules/stream_wrapper_example/templates/description.html.twig
  17. 4.0.x modules/ajax_example/templates/description.html.twig
  18. 4.0.x modules/field_example/templates/description.html.twig
  19. 4.0.x tests/modules/examples_description_test/templates/description.html.twig
Same filename in other branches
  1. 3.x modules/menu_example/templates/description.html.twig
  2. 3.x modules/form_api_example/templates/description.html.twig
  3. 3.x modules/js_example/templates/description.html.twig
  4. 3.x modules/page_example/templates/description.html.twig
  5. 3.x modules/node_type_example/templates/description.html.twig
  6. 3.x modules/pager_example/templates/description.html.twig
  7. 3.x modules/block_example/templates/description.html.twig
  8. 3.x modules/tabledrag_example/templates/description.html.twig
  9. 3.x modules/rest_example/templates/description.html.twig
  10. 3.x modules/testing_example/templates/description.html.twig
  11. 3.x modules/tour_example/templates/description.html.twig
  12. 3.x modules/config_entity_example/templates/description.html.twig
  13. 3.x modules/phpunit_example/templates/description.html.twig
  14. 3.x modules/render_example/templates/description.html.twig
  15. 3.x modules/field_permission_example/templates/description.html.twig
  16. 3.x modules/stream_wrapper_example/templates/description.html.twig
  17. 3.x modules/ajax_example/templates/description.html.twig
  18. 3.x modules/hooks_example/templates/description.html.twig
  19. 3.x modules/field_example/templates/description.html.twig
  20. 3.x tests/modules/examples_description_test/templates/description.html.twig
{#

Description text for the Hooks Example.

#}

{% set help_hooks_example = path('help.page', {'name': 'hooks_example'}) %}
{% set node_add_page = path('node.add_page') %}
{% set user_login = path('user.login') %}

{% trans %}

<h2>Implementing, defining, and invoking hooks</h2>

<p>The code in this module implements a couple of new features which you can see
in action.</p>

<p><strong>Implements <code>hook_help()</code>:</strong> In
<code>hooks_example.module</code> you'll find an implementation of the
<code>hook hook_help()</code> which is used to add contents to this module's
help overview. Visible at <a href={{ help_hooks_example }}>
<code>admin/help/hooks_example</code></a>.</p>

<p><strong>View counts:</strong> <code>hooks_example_node_view()</code> is an
implementation of the hook <code>hook_ENTITY_TYPE_view()</code> that adds a
basic page view counter. You can see this in action by navigating to any node on
the site and looking for the the text telling you how many times you've viewed
that page.</p>

<p>Don't have any nodes? <a href={{ node_add_page }}>Add some</a> and look at
their counters.</p>

<p><strong>Implements <code>hook_form_alter()</code>:</strong> In
<code>hooks_example.module</code> you'll find an implementation of
<code>hook_form_alter()</code> which demonstrates the use of one of the most
commonly used alter hooks. You can view the altered form at
<a href={{ user_login }}><code>user/login</code></a>.</p>

<p>To learn more about how to implement an existing hook, or how to define and
invoke a new hook start by reading the <code>@docblock</code> comments in
<code>hooks_example.module</code>.</p>

{% endtrans %}

File

modules/hooks_example/templates/description.html.twig

View source
  1. {#
  2. Description text for the Hooks Example.
  3. #}
  4. {% set help_hooks_example = path('help.page', {'name': 'hooks_example'}) %}
  5. {% set node_add_page = path('node.add_page') %}
  6. {% set user_login = path('user.login') %}
  7. {% trans %}
  8. <h2>Implementing, defining, and invoking hooks</h2>
  9. <p>The code in this module implements a couple of new features which you can see
  10. in action.</p>
  11. <p><strong>Implements <code>hook_help()</code>:</strong> In
  12. <code>hooks_example.module</code> you'll find an implementation of the
  13. <code>hook hook_help()</code> which is used to add contents to this module's
  14. help overview. Visible at <a href={{ help_hooks_example }}>
  15. <code>admin/help/hooks_example</code></a>.</p>
  16. <p><strong>View counts:</strong> <code>hooks_example_node_view()</code> is an
  17. implementation of the hook <code>hook_ENTITY_TYPE_view()</code> that adds a
  18. basic page view counter. You can see this in action by navigating to any node on
  19. the site and looking for the the text telling you how many times you've viewed
  20. that page.</p>
  21. <p>Don't have any nodes? <a href={{ node_add_page }}>Add some</a> and look at
  22. their counters.</p>
  23. <p><strong>Implements <code>hook_form_alter()</code>:</strong> In
  24. <code>hooks_example.module</code> you'll find an implementation of
  25. <code>hook_form_alter()</code> which demonstrates the use of one of the most
  26. commonly used alter hooks. You can view the altered form at
  27. <a href={{ user_login }}><code>user/login</code></a>.</p>
  28. <p>To learn more about how to implement an existing hook, or how to define and
  29. invoke a new hook start by reading the <code>@docblock</code> comments in
  30. <code>hooks_example.module</code>.</p>
  31. {% endtrans %}