class LocalActionWithDestination
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/Menu/LocalActionWithDestination.php \Drupal\Core\Menu\LocalActionWithDestination
Modifies the local action to add a destination.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Menu\LocalActionDefault implements \Drupal\Core\Menu\LocalActionInterface, \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\Core\Cache\CacheableDependencyInterface uses \Drupal\Core\DependencyInjection\DependencySerializationTrait extends \Drupal\Component\Plugin\PluginBase
- class \Drupal\Core\Menu\LocalActionWithDestination extends \Drupal\Core\Menu\LocalActionDefault
- class \Drupal\Core\Menu\LocalActionDefault implements \Drupal\Core\Menu\LocalActionInterface, \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\Core\Cache\CacheableDependencyInterface uses \Drupal\Core\DependencyInjection\DependencySerializationTrait extends \Drupal\Component\Plugin\PluginBase
Expanded class hierarchy of LocalActionWithDestination
1 string reference to 'LocalActionWithDestination'
- menu_ui.links.action.yml in core/
modules/ menu_ui/ menu_ui.links.action.yml - core/modules/menu_ui/menu_ui.links.action.yml
File
-
core/
lib/ Drupal/ Core/ Menu/ LocalActionWithDestination.php, line 13
Namespace
Drupal\Core\MenuView source
class LocalActionWithDestination extends LocalActionDefault {
public function __construct(array $configuration, $plugin_id, $plugin_definition, RouteProviderInterface $route_provider, protected RedirectDestinationInterface $redirectDestination) {
parent::__construct($configuration, $plugin_id, $plugin_definition, $route_provider);
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container->get('router.route_provider'), $container->get('redirect.destination'));
}
/**
* {@inheritdoc}
*/
public function getOptions(RouteMatchInterface $route_match) {
$options = parent::getOptions($route_match);
// Append the current path or destination to the query string.
$options['query']['destination'] = $this->redirectDestination
->get();
return $options;
}
}
Members
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.