function statistics_help

Same name in other branches
  1. 7.x modules/statistics/statistics.module \statistics_help()
  2. 9 core/modules/statistics/statistics.module \statistics_help()
  3. 8.9.x core/modules/statistics/statistics.module \statistics_help()
  4. 10 core/modules/statistics/statistics.module \statistics_help()

Implements hook_help().

File

core/modules/statistics/statistics.module, line 19

Code

function statistics_help($route_name, RouteMatchInterface $route_match) {
    switch ($route_name) {
        case 'help.page.statistics':
            $output = '';
            $output .= '<h2>' . t('About') . '</h2>';
            $output .= '<p>' . t('The Statistics module shows you how often content is viewed. This is useful in determining which pages of your site are most popular. For more information, see the <a href=":statistics_do">online documentation for the Statistics module</a>.', [
                ':statistics_do' => 'https://www.drupal.org/documentation/modules/statistics/',
            ]) . '</p>';
            $output .= '<h2>' . t('Uses') . '</h2>';
            $output .= '<dl>';
            $output .= '<dt>' . t('Displaying popular content') . '</dt>';
            $output .= '<dd>' . t('The module includes a <em>Popular content</em> block that displays the most viewed pages today and for all time, and the last content viewed. To use the block, enable <em>Count content views</em> on the <a href=":statistics-settings">Statistics page</a>, and then you can enable and configure the block on the <a href=":blocks">Block layout page</a>.', [
                ':statistics-settings' => Url::fromRoute('statistics.settings')->toString(),
                ':blocks' => \Drupal::moduleHandler()->moduleExists('block') ? Url::fromRoute('block.admin_display')->toString() : '#',
            ]) . '</dd>';
            $output .= '<dt>' . t('Page view counter') . '</dt>';
            $output .= '<dd>' . t('The Statistics module includes a counter for each page that increases whenever the page is viewed. To use the counter, enable <em>Count content views</em> on the <a href=":statistics-settings">Statistics page</a>, and set the necessary <a href=":permissions">permissions</a> (<em>View content hits</em>) so that the counter is visible to the users.', [
                ':statistics-settings' => Url::fromRoute('statistics.settings')->toString(),
                ':permissions' => Url::fromRoute('user.admin_permissions.module', [
                    'modules' => 'statistics',
                ])->toString(),
            ]) . '</dd>';
            $output .= '</dl>';
            return $output;
        case 'statistics.settings':
            return '<p>' . t('Settings for the statistical information that Drupal will keep about the site.') . '</p>';
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.