getViewsDisplayIDsWithRoute example

return $this->viewsDisplayPairs;
  }

  /** * Returns a set of route objects. * * @return \Symfony\Component\Routing\RouteCollection * A route collection. */
  public function routes() {
    $collection = new RouteCollection();
    foreach ($this->getViewsDisplayIDsWithRoute() as $pair) {
      [$view_id$display_id] = explode('.', $pair);
      $view = $this->viewStorage->load($view_id);
      // @todo This should have an executable factory injected.       if (($view = $view->getExecutable()) && $view instanceof ViewExecutable) {
        if ($view->setDisplay($display_id) && $display = $view->displayHandlers->get($display_id)) {
          if ($display instanceof DisplayRouterInterface) {
            $this->viewRouteNames += (array) $display->collectRoutes($collection);
          }
        }
        $view->destroy();
      }
    }
Home | Imprint | This part of the site doesn't use cookies.