You are here

public function MiconIconize::setIcon in Micon 2.x

Same name and namespace in other branches
  1. 8 src/MiconIconize.php \Drupal\micon\MiconIconize::setIcon()

Given a string, check to see if we have an Micon package icon match.

If found it will be set it as the current icon. Using this method to set the icon will skip any automatic text icon lookup.

Parameters

string $icon_id: The ID if the icon that should be used. This ID is defined in the Micon package.

Return value

$this

1 call to MiconIconize::setIcon()
MiconIconize::getMatch in src/MiconIconize.php
Match a string agaist definition and packages.

File

src/MiconIconize.php, line 169

Class

MiconIconize
Class MiconIconize.

Namespace

Drupal\micon

Code

public function setIcon($icon_id) {
  $this->icon = $this->miconManager
    ->getIconMatch($icon_id);
  return $this;
}