function _bootstrap_icon

8 deprecated.php _bootstrap_icon($name, $default = NULL)
7 common.inc _bootstrap_icon($name, $default = NULL)

Returns a specific Bootstrap Glyphicon.

  // Before.
  $icon = _bootstrap_icon($name, $default);

  // After.
  use Drupal\bootstrap\Bootstrap;
  use Drupal\bootstrap\Utility\Element;
  $icon = (string) Element::createStandalone(Bootstrap::glyphicon($name, ['#markup' => $default]))->renderPlain();

Parameters

string $name: The icon name, minus the "glyphicon-" prefix.

string $default: (Optional) The default value to return.

Return value

string The HTML markup containing the icon defined by $name, $default value if icon does not exist or returns empty output for whatever reason.

Deprecated

Will be removed in a future release.

Source ./deprecated.php (line 424)

function _bootstrap_icon($name, $default = NULL) {
  Bootstrap::deprecated();
  return Element::createStandalone(Bootstrap::glyphicon($name, ['#markup' => $default]))->renderPlain();
}