class UserTrackerTab
Same name in other branches
- 9 core/modules/tracker/src/Plugin/Menu/UserTrackerTab.php \Drupal\tracker\Plugin\Menu\UserTrackerTab
- 8.9.x core/modules/tracker/src/Plugin/Menu/UserTrackerTab.php \Drupal\tracker\Plugin\Menu\UserTrackerTab
- 10 core/modules/tracker/src/Plugin/Menu/UserTrackerTab.php \Drupal\tracker\Plugin\Menu\UserTrackerTab
Provides route parameters needed to link to the current user tracker tab.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Menu\LocalTaskDefault extends \Drupal\Component\Plugin\PluginBase implements \Drupal\Core\Menu\LocalTaskInterface, \Drupal\Core\Cache\CacheableDependencyInterface uses \Drupal\Core\DependencyInjection\DependencySerializationTrait
- class \Drupal\tracker\Plugin\Menu\UserTrackerTab extends \Drupal\Core\Menu\LocalTaskDefault implements \Drupal\Core\Plugin\ContainerFactoryPluginInterface
- class \Drupal\Core\Menu\LocalTaskDefault extends \Drupal\Component\Plugin\PluginBase implements \Drupal\Core\Menu\LocalTaskInterface, \Drupal\Core\Cache\CacheableDependencyInterface uses \Drupal\Core\DependencyInjection\DependencySerializationTrait
Expanded class hierarchy of UserTrackerTab
1 string reference to 'UserTrackerTab'
- tracker.links.task.yml in core/
modules/ tracker/ tracker.links.task.yml - core/modules/tracker/tracker.links.task.yml
File
-
core/
modules/ tracker/ src/ Plugin/ Menu/ UserTrackerTab.php, line 14
Namespace
Drupal\tracker\Plugin\MenuView source
class UserTrackerTab extends LocalTaskDefault implements ContainerFactoryPluginInterface {
/**
* Current user object.
*
* @var \Drupal\Core\Session\AccountInterface
*/
protected $currentUser;
/**
* Construct the UserTrackerTab object.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin_id for the plugin instance.
* @param array $plugin_definition
* The plugin implementation definition.
* @param \Drupal\Core\Session\AccountInterface $current_user
* The current user.
*/
public function __construct(array $configuration, $plugin_id, array $plugin_definition, AccountInterface $current_user) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->currentUser = $current_user;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container->get('current_user'));
}
/**
* {@inheritdoc}
*/
public function getRouteParameters(RouteMatchInterface $route_match) {
return [
'user' => $this->currentUser
->id(),
];
}
}
Members
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.