Drupal 8  8.0.2
LoginLogoutMenuLink Class Reference
Inheritance diagram for LoginLogoutMenuLink:

Public Member Functions

 __construct (array $configuration, $plugin_id, $plugin_definition, StaticMenuLinkOverridesInterface $static_override, AccountInterface $current_user)
 
 getTitle ()
 
 getRouteName ()
 
 getCacheContexts ()
 
- Public Member Functions inherited from PluginBase
 __construct (array $configuration, $plugin_id, $plugin_definition)
 
 getPluginId ()
 
 getBaseId ()
 
 getDerivativeId ()
 
 getPluginDefinition ()
 

Static Public Member Functions

static create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
 

Protected Attributes

 $currentUser
 
- Protected Attributes inherited from PluginBase
 $pluginId
 
 $pluginDefinition
 
 $configuration
 

Additional Inherited Members

- Data Fields inherited from PluginBase
const DERIVATIVE_SEPARATOR = ':'
 

Detailed Description

A menu link that shows "Log in" or "Log out" as appropriate.

Constructor & Destructor Documentation

__construct ( array  $configuration,
  $plugin_id,
  $plugin_definition,
StaticMenuLinkOverridesInterface  $static_override,
AccountInterface  $current_user 
)

Constructs a new LoginLogoutMenuLink.

Parameters
array$configurationA configuration array containing information about the plugin instance.
string$plugin_idThe plugin_id for the plugin instance.
mixed$plugin_definitionThe plugin implementation definition.
\Drupal\Core\Menu\StaticMenuLinkOverridesInterface$static_overrideThe static override storage.
\Drupal\Core\Session\AccountInterface$current_userThe current user.

References Drupal\currentUser().

Here is the call graph for this function:

Member Function Documentation

static create ( ContainerInterface  $container,
array  $configuration,
  $plugin_id,
  $plugin_definition 
)
static

{Creates an instance of the plugin.

Parameters
\Symfony\Component\DependencyInjection\ContainerInterface$containerThe container to pull out services used in the plugin.
array$configurationA configuration array containing information about the plugin instance.
string$plugin_idThe plugin ID for the plugin instance.
mixed$plugin_definitionThe plugin implementation definition.
Returns
static Returns an instance of this plugin.
}

Implements ContainerFactoryPluginInterface.

getCacheContexts ( )

{The cache contexts associated with this object.These identify a specific variation/representation of the object.Cache contexts are tokens: placeholders that are converted to cache keys by the service. The replacement value depends on the request context (the current URL, language, and so on). They're converted before storing an object in cache.

Returns
string[] An array of cache context tokens, used to generate a cache ID.
See Also
::convertTokensToKeys()
}

Implements CacheableDependencyInterface.

getRouteName ( )

{Returns the route name, if available.

Returns
string The name of the route this menu link links to.
}

Implements MenuLinkInterface.

References Drupal\currentUser().

Here is the call graph for this function:

getTitle ( )

{Returns the localized title to be shown for this link.

Returns
string The title of the menu link.
}

Implements MenuLinkInterface.

References Drupal\currentUser(), and t().

Here is the call graph for this function:


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