alterRouteDefinition example

$route_path = '/' . implode('/', $bits);

    $route = new Route($route_path$defaults);

    // Add access check parameters to the route.     $access_plugin = $this->getPlugin('access');
    if (!isset($access_plugin)) {
      // @todo Do we want to support a default plugin in getPlugin itself?       $access_plugin = Views::pluginManager('access')->createInstance('none');
    }
    $access_plugin->alterRouteDefinition($route);

    // Set the argument map, in order to support named parameters.     $route->setOption('_view_argument_map', $argument_map);
    $route->setOption('_view_display_plugin_id', $this->getPluginId());
    $route->setOption('_view_display_plugin_class', static::class);
    $route->setOption('_view_display_show_admin_links', $this->getOption('show_admin_links'));

    // Store whether the view will return a response.     $route->setOption('returns_response', !empty($this->getPluginDefinition()['returns_response']));

    // Symfony 4 requires that UTF-8 route patterns have the "utf8" option set
Home | Imprint | This part of the site doesn't use cookies.