You are here

robotstxt.module in RobotsTxt 8

Same filename and directory in other branches
  1. 5 robotstxt.module
  2. 6 robotstxt.module
  3. 7 robotstxt.module

File

robotstxt.module
View source
<?php

use Drupal\Core\Url;
use Drupal\Core\Routing\RouteMatchInterface;

/**
 * Implements hook_help().
 */
function robotstxt_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    case 'help.page.robotstxt':
      return '<p>' . t('In a multisite environment, there is no mechanism for having a separate robots.txt file for each site. This module addresses that need by letting you administer the robots.txt file from the settings interface.') . '</p>';
    case 'robotstxt.admin_settings_form':

      // Use base_path() or we may get an URL like "/en/robots.txt" and
      // "/de/robots.txt" on sites with URL language negotiation.
      return t('See <a href="http://www.robotstxt.org/">http://www.robotstxt.org/</a> for more information concerning how to write your <a href=":robotstxt">robots.txt</a> file.', [
        ':robotstxt' => Url::fromUri('base://robots.txt')
          ->toString(),
      ]);
  }
}

Functions

Namesort descending Description
robotstxt_help Implements hook_help().