function _bootstrap_icon in Express 8
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.
See also
\Drupal\bootstrap\Bootstrap::glyphicon()
File
- themes/
contrib/ bootstrap/ deprecated.php, line 424 - This contains deprecated functions that will be removed in a future release.
Code
function _bootstrap_icon($name, $default = NULL) {
Bootstrap::deprecated();
return Element::createStandalone(Bootstrap::glyphicon($name, [
'#markup' => $default,
]))
->renderPlain();
}