You are here

public function MiconIconize::setMatchString in Micon 2.x

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

The machine string to use as the match when looking for icons.

Parameters

string $string: A string that will be used to search through the icon definitions as well as the Micon icons to return a confirmed match.

Return value

$this

1 call to MiconIconize::setMatchString()
MiconIconize::getMatchString in src/MiconIconize.php
Return cleaned and lowercase string.

File

src/MiconIconize.php, line 259

Class

MiconIconize
Class MiconIconize.

Namespace

Drupal\micon

Code

public function setMatchString($string) {
  if (is_a($string, '\\Drupal\\Core\\StringTranslation\\TranslatableMarkup')) {
    $string = $string
      ->getUntranslatedString();
  }
  $this->matchString = strtolower(strip_tags($string));
  return $this;
}