You are here

public function Robots::setValue in Metatag 8

Sets the value of this tag.

Parameters

string|array $value: The value to set to this tag. It can be an array if it comes from a form submission or from field defaults, in which case we transform it to a comma-separated string.

Overrides MetaNameBase::setValue

File

src/Plugin/metatag/Tag/Robots.php, line 35

Class

Robots
The basic "Robots" meta tag.

Namespace

Drupal\metatag\Plugin\metatag\Tag

Code

public function setValue($value) {
  if (is_array($value)) {
    $value = array_filter($value);
    $value = implode(', ', array_keys($value));
  }
  $this->value = $value;
}