You are here

public static function SchemaMetatagManager::explode in Schema.org Metatag 7

Explode values if this is a multiple value field.

Parameters

string $value: The value to explode.

Return value

array The array of values.

Overrides SchemaMetatagManagerInterface::explode

2 calls to SchemaMetatagManager::explode()
SchemaItemListElementBase::getItems in src/SchemaItemListElementBase.php
Process the input value into an array of items.
SchemaNameBase::processTestExplodeValue in src/SchemaNameBase.php
Explode a test value.

File

src/SchemaMetatagManager.php, line 183
A generic substitution for Drupal 8 Random utility.

Class

SchemaMetatagManager
Class SchemaMetatagManager.

Code

public static function explode($value) {
  $value = explode(',', $value);
  $value = array_map('trim', $value);

  //$value = array_unique($value);
  if (count($value) == 1) {
    return $value[0];
  }
  return $value;
}