protected function LoginRedirectPerRole::setDestination in Login And Logout Redirect Per Role 8
Set "destination" parameter to do redirect.
Parameters
string $key: Configuration key (login or logout).
\Drupal\Core\Session\AccountInterface|null $account: User account to set destination for.
2 calls to LoginRedirectPerRole::setDestination()
- LoginRedirectPerRole::setLoginDestination in src/
LoginRedirectPerRole.php - Set Login destination parameter to do redirect.
- LoginRedirectPerRole::setLogoutDestination in src/
LoginRedirectPerRole.php - Set Logout destination parameter to do redirect.
File
- src/
LoginRedirectPerRole.php, line 142
Class
- LoginRedirectPerRole
- Login And Logout Redirect Per Role helper service.
Namespace
Drupal\login_redirect_per_roleCode
protected function setDestination($key, AccountInterface $account = NULL) {
$url = $this
->getRedirectUrl($key, $account);
if ($url instanceof Url) {
$this->currentRequest->query
->set('destination', $url
->toString());
}
}