Browse Source

Merge branch '3334297-add-hook-help' into '3.x'

Resolve #3334297 "Add hook help"

See merge request project/twig_tweak!18
merge-requests/18/merge
Jitesh Jhamtani 2 years ago
parent
commit
f68ff5c648
  1. 25
      twig_tweak.module

25
twig_tweak.module

@ -0,0 +1,25 @@
<?php
/**
* @file
* Primary module hooks for Twig Tweak module.
*/
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\StringTranslation\TranslatableMarkup;
/**
* Implements hook_help().
*/
function twig_tweak_help($route_name, RouteMatchInterface $route_match) {
if ($route_name == 'help.page.twig_tweak') {
$output = '';
$output .= '<h3>' . (string) new TranslatableMarkup('About') . '</h3>';
$output .= '<p>' . (string) new TranslatableMarkup('Twig Tweak is a small module which provides a Twig extension with some useful functions and filters that can improve development experience.') . '</p>';
$output .= '<p>' . (string) new TranslatableMarkup('You can click on the links below for more information about this module.') . '</p>';
$output .= '<p>' . (string) new TranslatableMarkup('<a href=":project_link">Project page</a>', [
':project_link' => 'https://www.drupal.org/project/twig_tweak',
]) . '</p>';
return $output;
}
}
Loading…
Cancel
Save