You are here

public static function UIkitComponents::getComponentURL in UIkit Components 8.2

Same name and namespace in other branches
  1. 8.3 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 118

Class

UIkitComponents
Class UIkitComponents

Namespace

Drupal\uikit_components

Code

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/v2/docs/' . $component . '.html';
    return Url::fromUri($uri)
      ->toString();
  }
}