Browse Source
Resolve #3334297 "Add hook help" See merge request project/twig_tweak!18merge-requests/18/merge
1 changed files with 25 additions and 0 deletions
@ -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…
Reference in new issue