/** * {@inheritdoc} */ public function getOptions(RouteMatchInterface $route_match) { $options = parent::getOptions($route_match); // Append the current path as destination to the query string. $options['query']['destination'] = $this->redirectDestination->get(); return $options; }
/** * {@inheritdoc} */ public function getOptions(RouteMatchInterface $route_match) { $options = parent::getOptions($route_match); // If the route specifies a theme, append it to the query string. if ($theme = $route_match->getParameter('theme')) { $options['query']['theme'] = $theme; } // Adds a destination on custom block listing. if ($route_match->getRouteName() == 'entity.block_content.collection') { $options['query']['destination'] = $this->url('<current>'); } return $options; }
/** * {@inheritdoc} */ public function getOptions(Request $request) { $options = parent::getOptions($request); // Append the current path as destination to the query string. if ($request->attributes->has(RouteObjectInterface::ROUTE_NAME)) { $route_name = $request->attributes->get(RouteObjectInterface::ROUTE_NAME); $raw_variables = array(); if ($request->attributes->has('_raw_variables')) { $raw_variables = $request->attributes->get('_raw_variables')->all(); } // @todo Use RouteMatch instead of Request. // https://www.drupal.org/node/2294157 $options['query']['destination'] = \Drupal::urlGenerator()->generateFromRoute($route_name, $raw_variables); } return $options; }
/** * {@inheritdoc} */ public function getOptions(Request $request) { $options = parent::getOptions($request); // If the route specifies a theme, append it to the query string. if ($request->attributes->has('theme')) { $options['query']['theme'] = $request->attributes->get('theme'); } // Adds a destination on custom block listing. if ($request->attributes->get(RouteObjectInterface::ROUTE_NAME) == 'block_content.list') { $options['query']['destination'] = 'admin/structure/block/block-content'; } // Adds a destination on custom block listing. if ($request->attributes->get(RouteObjectInterface::ROUTE_NAME) == 'block_content.list') { $options['query']['destination'] = 'admin/structure/block/block-content'; } return $options; }