public static function UIkitComponents::getComponentURL in UIkit Components 8.3
Same name and namespace in other branches
- 8.2 src/UIkitComponents.php \Drupal\uikit_components\UIkitComponents::getComponentURL()
Get the UIkit documentation URL for the given component.
Parameters
string $component: The component to return a URL for.
Return value
string Returns a URL for the given component if set, FALSE otherwise.
1 call to UIkitComponents::getComponentURL()
- MenuEditForm::form in src/
Form/ MenuEditForm.php - Gets the actual form array to be built.
File
- src/
UIkitComponents.php, line 168
Class
- UIkitComponents
- Provides helper functions for the UIkit Components module.
Namespace
Drupal\uikit_componentsCode
public static function getComponentURL($component) {
if (!$component) {
\Drupal::messenger()
->addWarning(t('URL cannot be returned, no component was given in <em class="placeholder">UIkitComponents::getComponentURL()</em>.'));
return FALSE;
}
else {
$uri = 'https://getuikit.com/docs/' . $component;
return Url::fromUri($uri)
->toString();
}
}