You are here

responsivewrappers.module in Responsive wrappers 8

Same filename and directory in other branches
  1. 7 responsivewrappers.module
  2. 2.0.x responsivewrappers.module

Module file for responsivewrappers.

File

responsivewrappers.module
View source
<?php

/**
 * @file
 * Module file for responsivewrappers.
 */
use Drupal\Core\Routing\RouteMatchInterface;

/**
 * Implements hook_help().
 *
 * @inheritdoc
 */
function responsivewrappers_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    case 'help.page.responsivewrappers':
      $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.
        $settings = \Drupal::configFactory()
          ->get('markdown.settings')
          ->getRawData();
        $filter = \Drupal::service('plugin.manager.filter')
          ->createInstance('markdown', [
          'settings' => $settings,
        ]);
        $output = $filter
          ->process($text, 'en');
      }
      return $output;
  }
}

Functions

Namesort descending Description
responsivewrappers_help Implements hook_help().