protected ControllerBase::currentUser()
Returns the current user.
Return value
\Drupal\Core\Session\AccountInterface The current user.
File
- core/lib/Drupal/Core/Controller/ControllerBase.php, line 262
Class
- ControllerBase
- Utility base class for thin controllers.
Namespace
Drupal\Core\Controller
Code
protected function currentUser() { if (!$this->currentUser) { $this->currentUser = $this->container()->get('current_user'); } return $this->currentUser; }
Please login to continue.