Bootstrap\View\Helper\BootstrapTrait::_makeIcon PHP Method

_makeIcon() protected method

Try to convert the specified $text to a bootstrap icon. The $text is converted if it matches a format "i:icon-name".
protected _makeIcon ( $title, &$converted = false ) : The
$title The text to convert.
$converted If specified, will contains true if the text was converted, false otherwize.
return The icon element if the conversion was successful, otherwize $text. Note: This function will currently fail if the Html helper associated with the view is not BootstrapHtmlHelper.
    protected function _makeIcon($title, &$converted = false)
    {
        $converted = false;
        if (!$this->easyIcon) {
            return $title;
        }
        $title = preg_replace_callback('#(^|\\s+)i:([a-zA-Z0-9\\-_]+)(\\s+|$)#', function ($matches) {
            return $matches[1] . $this->_View->Html->icon($matches[2]) . $matches[3];
        }, $title, -1, $count);
        $converted = (bool) $count;
        return $title;
    }