Skip to content
Snippets Groups Projects

added hook_help

1 file
+ 27
0
Compare changes
  • Side-by-side
  • Inline
+ 27
0
<?php
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Url;
/**
* @file
* The library_generator module file.
@@ -12,3 +15,27 @@ function library_generator_library_info_alter(&$libraries, $extension) {
$generated_libraries = \Drupal::service('library_generator.discovery')->getLibrariesByExtension($extension);
$libraries = array_merge($generated_libraries, $libraries);
}
/**
* Implements hook_help().
*/
function library_generator_help($route_name, RouteMatchInterface $route_match)
{
switch ($route_name) {
case 'help.page.library_generator':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t(
'The Library Generator module generates asset libraries for CSS and JS files in modules and themes, see the <a href=":handbook">
online documentation for the Custom Account Link module</a>.',
[
':library_generator' => Url::fromRoute('help.page', ['name' => 'library_generator'])->toString(),
':handbook' => 'https://www.drupal.org/project/library_generator'
]
) . '</p>';
$output .= '<h3>' . t('Uses') . '</h3>';
$output .= '<p>' . t(' This module is used when you want a separate asset library for each CSS and JS file without having to add them manually to your *.libraries.yml');
$output .= '</p>';
return $output;
}
}
\ No newline at end of file
Loading