public function addIconToText($text, OptionsParser $options)
    {
        $icon = $options->consume('icon');
        $align = $options->consume('icon-align');

        if (!$icon) {
            return [$text, $options];
        }

        $icon = $this->icon($icon);

        if (empty($text)) {
            $text = $icon;
        } elseif ($align === 'right') {
            $text = sprintf('%s %s', $text, $icon);
        } else {
            $text = sprintf('%s %s', $icon, $text);
        }

        return [$text, $options];
    }
public function addIconToText($text, OptionsParser $options)
    {
        $icon = $options->consume('icon');
        $align = $options->consume('icon-align');

        if (!$icon) {
            return [$text, $options];
        }

        $icon = $this->icon($icon);

        if (empty($text)) {
            $text = $icon;
        } elseif ($align === 'right') {
            $text = sprintf('%s %s', $text, $icon);
        } else {
            $text = sprintf('%s %s', $icon, $text);
        }

        return [$text, $options];
    }
public function addIconToText ( $ text , OptionsParser $ options ) { $ icon = $ options -> consume ( 'icon' ) ; $ align = $ options -> consume ( 'icon-align' ) ; if ( ! $ icon ) { return [ $ text , $ options ] ; } $ icon = $ this -> icon ( $ icon ) ; if ( empty ( $ text ) ) { $ text = $ icon ; } elseif ( $ align === 'right' ) { $ text = sprintf ( '%s %s' , $ text , $ icon ) ; } else { $ text = sprintf ( '%s %s' , $ icon , $ text ) ; } return [ $ text , $ options ] ; }
Adds icons to text
@param string $text Text
@param OptionsParser $options Instance of `OptionsParser`
@return array Text with icons and instance of `OptionsParser`
@since 2.16.2-beta
@uses icon()
Adds icons to text