You are here

public function StatuspageController::routes in Nagios Monitoring 8

Route callback to allow for user-defined URL of status page.

Return value

Route[]

1 string reference to 'StatuspageController::routes'
nagios.routing.yml in ./nagios.routing.yml
nagios.routing.yml

File

src/Controller/StatuspageController.php, line 139

Class

StatuspageController
Class StatuspageController produces the HTTP output that the bash script in the nagios-plugin directory understands.

Namespace

Drupal\nagios\Controller

Code

public function routes() {
  $config = \Drupal::config('nagios.settings');
  $routes = [];

  // Declares a single route under the name 'example.content'.
  // Returns an array of Route objects.
  $routes['nagios.statuspage'] = new Route($config
    ->get('nagios.statuspage.path') . '/{module_name}/{id_for_hook}', [
    '_controller' => $config
      ->get('nagios.statuspage.controller'),
    '_title' => 'Nagios Status',
    'module_name' => '',
    'id_for_hook' => '',
  ], [
    '_custom_access' => '\\Drupal\\nagios\\Controller\\StatuspageController::access',
  ]);
  return $routes;
}