You are here

public function EmptyPages::routes in Empty Page 8

1 string reference to 'EmptyPages::routes'
empty_page.routing.yml in ./empty_page.routing.yml
empty_page.routing.yml

File

src/Routing/EmptyPages.php, line 16

Class

EmptyPages
Defines a route subscriber to register a url from empty pages.

Namespace

Drupal\empty_page\Routing

Code

public function routes() {
  $routes = [];
  $callbacks = EmptyPageController::emptyPageGetCallbacks();
  if (!empty($callbacks)) {
    foreach ($callbacks as $cid => $callback) {
      $routes['empty_page.page_' . $cid] = new Route($callback['path'], [
        '_controller' => '\\Drupal\\empty_page\\Controller\\EmptyPage::emptyCallback',
        '_title' => $callback['page_title'],
      ], [
        '_permission' => 'view empty pages',
      ]);
    }
  }
  return $routes;
}