Make sure to have a class that starts with `fa-`.

@param string $icon_class

@return string
978539
protected function normalizeIconClass( $icon_class ) {
		$icon_class = trim( $icon_class );

		if ( stripos( $icon_class, 'fa-' ) === false ) {
			$icon_class = 'fa-' . $icon_class;
		}

		return $icon_class;
	}
617736
public static function get_icon_classes( $meta, $output = 'string' ) {
		$classes = array( '_mi' );

		if ( empty( $meta['hide_label'] ) ) {
			$classes[] = "_{$meta['position']}";
		}

		if ( 'string' === $output ) {
			$classes = implode( ' ', $classes );
		}

		return $classes;
	}
668718
protected function getIconCssClasses(?string $icon = null, bool $animated = false, array $cssClasses = [])
    {
        $cssClasses[] = 'fa';
        $cssClasses[] = $icon ?? $this->getIcon();
        if ($animated === true) {
            if ($this->getIcon() === 'fa-spinner') {
                $cssClasses[] = 'fa-pulse';
            } else if (in_array($this->getIcon(), ['fa-spinner', 'fa-circle-o-notch', 'fa-refresh', 'fa-cog'])) {
                $cssClasses[] = 'fa-spin';
            }
        }
        if ($this->iconColor) {
            $cssClasses[] = 'text-' . $this->iconColor;
        }
        return $cssClasses;
    }
1322496
protected function makeIcon($label_and_icon)
    {
        $parts = explode(',', $label_and_icon);
        if (count($parts) == 2) {
            return ['label' => $parts[0], 'icon' => $parts[1]];
        }

        return ['label' => $parts[0], 'icon' => 'default'];
    }
339823
public function sorter()
    {
        if (!$this->sortable) {
            return '';
        }

        $icon = 'fa-sort';
        $type = 'desc';

        if ($this->isSorted()) {
            $type = $this->sort['type'] == 'desc' ? 'asc' : 'desc';
            $icon .= "-amount-{$this->sort['type']}";
        }

        // set sort value
        $sort = ['column' => $this->name, 'type' => $type];
        if (isset($this->cast)) {
            $sort['cast'] = $this->cast;
        }

        $query = app('request')->all();
        $query = array_merge($query, [$this->grid->model()->getSortName() => $sort]);

        $url = url()->current().'?'.http_build_query($query);

        return "<a class=\"fa fa-fw $icon\" href=\"$url\"></a>";
    }
661475
public function getIcon($default = null, $show = true)
    {
        if ($this->icon !== null && $this->icon !== '' && $show == true ) {
            return '<i class="' . $this->icon . '"></i>';
        }
        if ($default === null && $show == true) {
            return $default;
        } else {
            return $this->icon;
        }
        return '<i class="' . $default . '"></i>';
    }
1227302
function _icon() {
  if (cache) { return cache }
  try {
    fs.accessSync(path.resolve(options.success))
    return cache = options.success;
  } catch(e){
    return cache = 'https://i.imgur.com/G6fTWAs.png';
  }
}
1126847
protected function getImage($name, $text = "", $class = null, $iconpath = TRUE, $flagpath = FALSE)
  {
    $src = "";

    if($iconpath)
    {
      $src = $this->iconpath;
    }

    if($flagpath)
    {
      $src = $this->flagpath;
    }

    return "<img src='" . $src . $name . "' title='" . $text . "' alt='' align='top' />";
  }
685380
public function get_action_icons(stdClass $instance) {
        global $OUTPUT;

        $context = context_course::instance($instance->courseid);

        $icons = array();
        if (has_capability('enrol/manual:enrol', $context) or has_capability('enrol/manual:unenrol', $context)) {
            $managelink = new moodle_url("/enrol/manual/manage.php", array('enrolid'=>$instance->id));
            $icons[] = $OUTPUT->action_icon($managelink, new pix_icon('t/enrolusers', get_string('enrolusers', 'enrol_manual'), 'core', array('class'=>'iconsmall')));
        }
        $parenticons = parent::get_action_icons($instance);
        $icons = array_merge($icons, $parenticons);

        return $icons;
    }
282731
public function icon($icon = null)
    {
        if ($icon === null) {
            return $this->_icon;
        }
        $this->_icon = $icon;

        return $this;
    }
1101794
private static function formTrailingTag($icon)
    {
        if ( ! config('columnsortable.enable_icons', true)) {
            return '</a>';
        }

        $iconAndTextSeparator = config('columnsortable.icon_text_separator', '');

        $clickableIcon = config('columnsortable.clickable_icon', false);
        $trailingTag   = $iconAndTextSeparator.'<i class="'.$icon.'"></i>'.'</a>';

        if ($clickableIcon === false) {
            $trailingTag = '</a>'.$iconAndTextSeparator.'<i class="'.$icon.'"></i>';

            return $trailingTag;
        }

        return $trailingTag;
    }
57670
protected function buildIcon(string $icon, bool $animated, array $cssClasses): string
    {
        return Html::buildHtmlElement('i', [], null, true, $this->getIconCssClasses($icon, $animated, $cssClasses));
    }
951169
public static function alert($html, $class = 'info', $icon = '')
		{
			if(is_bool($class))
			{
				$state  = !! $class;
				$class  = $state ? 'success' : 'danger';
				$icon   = $state ? 'check' : 'times';
			}
			if ($icon)
			{
				$html   = '<i class="fa fa-' .$icon. '" aria-hidden="true"></i> ' . $html;
			}
			return '<div class="alert alert-' .$class. '" role="alert">' .$html. '</div>';
		}
1092423
public static function iconIdentifier(string $iconKey, string $separator = '_'): string {
    $slugify        = new Slugify(['separator' => $separator]);
    $iconIdentifier = $slugify->slugify($iconKey);

    return $iconIdentifier;
  }
1127071
public function encodeIcon(ImageIcon $icon, Encoder $encoder)
    {
        return sprintf(
            '%s = L.icon(%s);',
            $encoder->encodeReference($icon),
            $encoder->encodeArguments(array($icon->getOptions()))
        );
    }
47381
public function onAdminBodyClass($class): string
    {
        $class = (string) $class;

        if (!$this->isOwn()) {
            return $class; // Not applicable.
        }
        $tab = $this->currentTab(); // Request var.
        $tab = !$tab || !$this->c::isSlug($tab) ? '' : $tab;

        $class .= ($class ? ' ' : '').$this->App::CORE_CONTAINER_SLUG.'-menu-page';
        $class .= ' '.$this->App->Config->©brand['©slug'].'-menu-page'; // App identifiers.
        $class .= $tab ? ' '.$this->App->Config->©brand['©slug'].'-menu-page-tab-'.$tab : '';

        return $class;
    }
944856
def render_icon(icon_class, options = {})
      options = {style: 'solid'}.merge(options)
      classes = [
        "icon fa-fw",
        "fa-#{icon_class}",
        "fa#{options[:style].first}",
        options[:size] ? "fa-#{options[:size]}" : nil,
        options[:transform] ? "fa-#{options[:transform]}" : nil,
        options[:class]
      ].compact
      content_tag('i', nil, class: classes)
    end