UserTrackerTab.php in Zircon Profile 8
File
core/modules/tracker/src/Plugin/Menu/UserTrackerTab.php
View source
<?php
namespace Drupal\tracker\Plugin\Menu;
use Drupal\Core\Menu\LocalTaskDefault;
use Drupal\Core\Routing\RouteMatchInterface;
class UserTrackerTab extends LocalTaskDefault {
protected $currentUser;
protected function currentUser() {
if (!$this->currentUser) {
$this->currentUser = \Drupal::currentUser();
}
return $this->currentUser;
}
public function getRouteParameters(RouteMatchInterface $route_match) {
return array(
'user' => $this
->currentUser()
->Id(),
);
}
}
Classes
Name |
Description |
UserTrackerTab |
Provides route parameters needed to link to the current user tracker tab. |