You are here

public static function ConfigForm::string_to_array in Insert 8.2

Parameters

array $element:

\Drupal\Core\Form\FormStateInterface $form_state:

File

src/Form/ConfigForm.php, line 184

Class

ConfigForm

Namespace

Drupal\insert\Form

Code

public static function string_to_array(array $element, &$form_state) {
  $value = str_replace(',', ' ', trim($element['#value']));
  $form_state
    ->setValueForElement($element, preg_split('/\\s+/', $value));
}