You are here

function diba_carousel_help in Diba carousel slider 8

Implements hook_help().

File

./diba_carousel.module, line 14
Diba carousel slider module.

Code

function diba_carousel_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    case 'help.page.diba_carousel':
      $text = file_get_contents(dirname(__FILE__) . '/README.md');
      if (!\Drupal::moduleHandler()
        ->moduleExists('markdown')) {
        $output = '<pre>' . $text . '</pre>';
      }
      else {

        // Use the Markdown filter to render the README file.
        $settings = \Drupal::configFactory()
          ->get('markdown.settings')
          ->getRawData();
        $filter = \Drupal::service('plugin.manager.filter')
          ->createInstance('markdown', [
          'settings' => $settings,
        ]);
        $output = $filter
          ->process($text, 'en');
      }
      return $output;
  }
}