function _bootstrap_icon

8 deprecated.php _bootstrap_icon($name, $default = NULL)
7 _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();


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.


Will be removed in a future release.

Source ./deprecated.php (line 424)

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