function _bootstrap_colorize_text

8.x-3.x deprecated.php _bootstrap_colorize_text($string, $default = '')
7.x-3.x _bootstrap_colorize_text($string, $default = '')

Matches a Bootstrap class based on a string value.

  // Before.
  $class = _bootstrap_colorize_text($string, $default);

  // After.
  use Drupal\bootstrap\Bootstrap;
  $class = Bootstrap::cssClassFromString($string, $default);


string $string: The string to match classes against.

string $default: The default class to return if no match is found.

Return value

string The Bootstrap class matched against the value of $haystack or $default if no match could be made.


Will be removed in a future release.

Source ./deprecated.php (line 189)

function _bootstrap_colorize_text($string, $default = '') {
  return Bootstrap::cssClassFromString($string, $default);