private function UserController::buildAchievementsPageUrl in Opigno statistics 3.x
Build the url to the achievement page with the anchor to the needed tab.
Parameters
\Drupal\Core\Url $url: The achievement page url object.
string $tab: The machine name of the tab that should be opened.
Return value
string The url to the achievement page with the anchor to the needed tab.
1 call to UserController::buildAchievementsPageUrl()
- UserController::buildUserInfo in src/
Controller/ UserController.php - Builds render array for a user info block.
File
- src/
Controller/ UserController.php, line 226
Class
- UserController
- Statistics user controller.
Namespace
Drupal\opigno_statistics\ControllerCode
private function buildAchievementsPageUrl(Url $url, string $tab = '') : string {
$result = '';
if ($url
->access()) {
$url = $tab ? $url
->setOptions([
'query' => [
'tab' => $tab,
],
]) : $url;
$url = $url
->toString();
$result = $url instanceof GeneratedUrl ? $url
->getGeneratedUrl() : $url;
}
return $result;
}