You are here

public function MiconIconize::getIcon in Micon 8

Same name and namespace in other branches
  1. 2.x src/MiconIconize.php \Drupal\micon\MiconIconize::getIcon()

Given a string, return the MiconIcon match.

If an icon has been found and set using setIcon() that icon will be immediately returned.

Parameters

bool $force_match: Force a match lookup even if $this->icon is already set.

Return value

\Drupal\micon\MiconIcon|null The MiconIcon if found, else null.

1 call to MiconIconize::getIcon()
MiconIconize::render in src/MiconIconize.php
Renders the object as a string.

File

src/MiconIconize.php, line 186

Class

MiconIconize
Class MiconIconize.

Namespace

Drupal\micon

Code

public function getIcon($force_match = FALSE) {
  if ($force_match || !$this->icon) {
    $this
      ->getMatch($this
      ->getMatchString());
  }
  return $this->icon;
}