Drupal 8  8.0.2
LocalTaskManager Class Reference
Inheritance diagram for LocalTaskManager:

Public Member Functions

 __construct (ControllerResolverInterface $controller_resolver, RequestStack $request_stack, RouteMatchInterface $route_match, RouteProviderInterface $route_provider, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache, LanguageManagerInterface $language_manager, AccessManagerInterface $access_manager, AccountInterface $account)
 processDefinition (&$definition, $plugin_id)
 getTitle (LocalTaskInterface $local_task)
 getDefinitions ()
 getLocalTasksForRoute ($route_name)
 getLocalTasks ($route_name, $level=0)
- Public Member Functions inherited from DefaultPluginManager
 __construct ($subdir,\Traversable $namespaces, ModuleHandlerInterface $module_handler, $plugin_interface=NULL, $plugin_definition_annotation_name= 'Drupal\Component\Annotation\Plugin')
 setCacheBackend (CacheBackendInterface $cache_backend, $cache_key, array $cache_tags=array())
 getDefinitions ()
 clearCachedDefinitions ()
 useCaches ($use_caches=FALSE)
 processDefinition (&$definition, $plugin_id)
- Public Member Functions inherited from PluginManagerBase
 getDefinition ($plugin_id, $exception_on_invalid=TRUE)
 getDefinitions ()
 createInstance ($plugin_id, array $configuration=array())
 getInstance (array $options)
- Public Member Functions inherited from DiscoveryInterface
 hasDefinition ($plugin_id)
- Public Member Functions inherited from LocalTaskManagerInterface
 getTasksBuild ($current_route_name, RefinableCacheableDependencyInterface &$cacheability)

Protected Member Functions

 getDiscovery ()
 isRouteActive ($current_route_name, $route_name, $route_parameters)
- Protected Member Functions inherited from DefaultPluginManager
 alterInfo ($alter_hook)
 getCachedDefinitions ()
 setCachedDefinitions ($definitions)
 getDiscovery ()
 getFactory ()
 findDefinitions ()
 alterDefinitions (&$definitions)
 providerExists ($provider)
- Protected Member Functions inherited from PluginManagerBase
 getDiscovery ()
 getFactory ()

Protected Attributes

 $instances = array()
- Protected Attributes inherited from DefaultPluginManager
 $cacheTags = array()
 $defaults = array()
- Protected Attributes inherited from PluginManagerBase

Detailed Description

Provides the default local task manager using YML as primary definition.

Constructor & Destructor Documentation

__construct ( ControllerResolverInterface  $controller_resolver,
RequestStack  $request_stack,
RouteMatchInterface  $route_match,
RouteProviderInterface  $route_provider,
ModuleHandlerInterface  $module_handler,
CacheBackendInterface  $cache,
LanguageManagerInterface  $language_manager,
AccessManagerInterface  $access_manager,
AccountInterface  $account 

Constructs a object.

\Drupal\Core\Controller\ControllerResolverInterface$controller_resolverAn object to use in introspecting route methods.
\Symfony\Component\HttpFoundation\RequestStack$request_stackThe request object to use for building titles and paths for plugin instances.
\Drupal\Core\Routing\RouteMatchInterface$route_matchThe current route match.
\Drupal\Core\Routing\RouteProviderInterface$route_providerThe route provider to load routes by name.
\Drupal\Core\Extension\ModuleHandlerInterface$module_handlerThe module handler.
\Drupal\Core\Cache\CacheBackendInterface$cacheThe cache backend.
\Drupal\Core\Language\LanguageManagerInterface$language_managerThe language manager.
\Drupal\Core\Access\AccessManagerInterface$access_managerThe access manager.
\Drupal\Core\Session\AccountInterface$accountThe current user.

References Drupal\accessManager(), DefaultPluginManager\alterInfo(), LanguageManagerInterface\getCurrentLanguage(), Drupal\moduleHandler(), Drupal\requestStack(), Drupal\routeMatch(), and DefaultPluginManager\setCacheBackend().

Here is the call graph for this function:

Member Function Documentation

getDefinitions ( )

{Gets the definition of all plugins for this type.

mixed[] An array of plugin definitions (empty array if no definitions were found). Keys are plugin IDs.

Implements DiscoveryInterface.

Referenced by LocalTaskManager\getLocalTasksForRoute().

Here is the caller graph for this function:

getDiscovery ( )


References YamlDiscovery\addTranslatableProperty(), and Drupal\moduleHandler().

Here is the call graph for this function:

getLocalTasks (   $route_name,
  $level = 0 

{Collects the local tasks (tabs) for the current route.

string$route_nameThe route for which to make renderable local tasks.
int$levelThe level of tasks you ask for. Primary tasks are 0, secondary are 1.
array An array containing
  • tabs: Local tasks render array for the requested level.
  • route_name: The route name for the current page used to collect the local tasks.
See Also

Implements LocalTaskManagerInterface.

References RefinableCacheableDependencyInterface\addCacheContexts(), LocalTaskManagerInterface\getTasksBuild(), Drupal\moduleHandler(), and Drupal\requestStack().

Here is the call graph for this function:

getLocalTasksForRoute (   $route_name)

{Find all local tasks that appear on a named route.

string$route_nameThe route for which to find local tasks.
array Returns an array of task levels. Each task level contains instances of local tasks (LocalTaskInterface) which appear on the tab route. The array keys are the depths and the values are arrays of plugin instances.

Implements LocalTaskManagerInterface.

References PluginManagerBase\createInstance(), LocalTaskManager\getDefinitions(), and Cache\PERMANENT.

Here is the call graph for this function:

getTitle ( LocalTaskInterface  $local_task)

{Gets the title for a local task.

\Drupal\Core\Menu\LocalTaskInterface$local_taskA local task plugin instance to get the title for.
string The localized title.

Implements LocalTaskManagerInterface.

References Drupal\requestStack().

Here is the call graph for this function:

isRouteActive (   $current_route_name,

Determines whether the route of a certain local task is currently active.

string$current_route_nameThe route name of the current main request.
string$route_nameThe route name of the local task to determine the active status.
bool Returns TRUE if the passed route_name and route_parameters is considered as the same as the one from the request, otherwise FALSE.

References Drupal\routeMatch().

Here is the call graph for this function:

processDefinition ( $definition,


Field Documentation

Initial value:
= array(
'route_name' => '',
'route_parameters' => array(),
'title' => '',
'base_route' => '',
'parent_id' => NULL,
'weight' => NULL,
'options' => array(),
'class' => 'Drupal\Core\Menu\LocalTaskDefault',
'id' => '',


The documentation for this class was generated from the following file: