function DbLogController::createLink
Same name in other branches
- 9 core/modules/dblog/src/Controller/DbLogController.php \Drupal\dblog\Controller\DbLogController::createLink()
- 8.9.x core/modules/dblog/src/Controller/DbLogController.php \Drupal\dblog\Controller\DbLogController::createLink()
- 11.x core/modules/dblog/src/Controller/DbLogController.php \Drupal\dblog\Controller\DbLogController::createLink()
Creates a Link object if the provided URI is valid.
Parameters
string|null $uri: The uri string to convert into link if valid.
Return value
\Drupal\Core\Link|string|null Return a Link object if the uri can be converted as a link. In case of empty uri or invalid, fallback to the provided $uri.
1 call to DbLogController::createLink()
- DbLogController::eventDetails in core/
modules/ dblog/ src/ Controller/ DbLogController.php - Displays details about a specific database log message.
File
-
core/
modules/ dblog/ src/ Controller/ DbLogController.php, line 396
Class
- DbLogController
- Returns responses for dblog routes.
Namespace
Drupal\dblog\ControllerCode
protected function createLink($uri) {
if ($uri !== NULL && UrlHelper::isValid($uri, TRUE)) {
return new Link($uri, Url::fromUri($uri));
}
return $uri;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.