You are here

public static function GridStack::parseAttributes in GridStack 8

Parses the given string attribute.

File

src/Entity/GridStack.php, line 401

Class

GridStack
Defines the GridStack configuration entity.

Namespace

Drupal\gridstack\Entity

Code

public static function parseAttributes($string = '') {
  $attributes = [];
  $layout_attributes = explode(',', $string);
  foreach ($layout_attributes as $attribute) {
    $replaced_attribute = $attribute;

    // @todo: Token support.
    if (strpos($attribute, '|') !== FALSE) {
      list($key, $value) = array_pad(array_map('trim', explode('|', $replaced_attribute, 2)), 2, NULL);
      $attributes[$key] = strip_tags($value);
    }
  }
  return $attributes;
}