You are here

protected function PlainStringFormatter::prepareClasses in String field formatter 2.0.x

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldFormatter/PlainStringFormatter.php \Drupal\string_field_formatter\Plugin\Field\FieldFormatter\PlainStringFormatter::prepareClasses()

Parameters

string $class:

Return value

string[]

2 calls to PlainStringFormatter::prepareClasses()
PlainStringFormatter::settingsSummary in src/Plugin/Field/FieldFormatter/PlainStringFormatter.php
Returns a short summary for the current formatter settings.
PlainStringFormatter::viewElements in src/Plugin/Field/FieldFormatter/PlainStringFormatter.php
Builds a renderable array for a field value.

File

src/Plugin/Field/FieldFormatter/PlainStringFormatter.php, line 136

Class

PlainStringFormatter
Plugin implementation of the 'plain_string_formatter' formatter.

Namespace

Drupal\string_field_formatter\Plugin\Field\FieldFormatter

Code

protected function prepareClasses($classes) {
  $prepared = [];
  foreach ($this
    ->explode($classes) as $class) {
    $prepared[] = Html::getClass($class);
  }
  return $prepared;
}