overrideAppliesPathAndMethod example


  protected function overrideApplies($view_path, Route $view_route, Route $route) {
    return (!$route->hasRequirement('_format') || $route->getRequirement('_format') === 'html')
      && $this->overrideAppliesPathAndMethod($view_path$view_route$route);
  }

  /** * Determines whether an override for the path and method should happen. * * @param string $view_path * The path of the view. * @param \Symfony\Component\Routing\Route $view_route * The route of the view. * @param \Symfony\Component\Routing\Route $route * The route itself. * * @return bool * TRUE, when the view should override the given route. */

  protected function overrideApplies($view_path, Route $view_route, Route $route) {
    $route_has_format = $route->hasRequirement('_format');
    $route_formats = $route_has_format ? explode('|', $route->getRequirement('_format')) : [];
    $view_route_formats = $view_route->hasRequirement('_format') ? explode('|', $view_route->getRequirement('_format')) : [];
    return $this->overrideAppliesPathAndMethod($view_path$view_route$route)
      && (!$route_has_format || array_intersect($route_formats$view_route_formats) != []);
  }

  /** * {@inheritdoc} */
  public static function buildResponse($view_id$display_id, array $args = []) {
    $build = static::buildBasicRenderable($view_id$display_id$args);

    // Setup an empty response so headers can be added as needed during views     // rendering and processing.
Home | Imprint | This part of the site doesn't use cookies.