You are here

class EmptyPages in Empty Page 8

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

Hierarchy

Expanded class hierarchy of EmptyPages

File

src/Routing/EmptyPages.php, line 11

Namespace

Drupal\empty_page\Routing
View source
class EmptyPages {

  /**
   * {@inheritdoc}
   */
  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;
  }

}

Members