You are here

protected static function TocFilter::setOption in TOC filter 8.2

Set nested option name and value.

From: http://stackoverflow.com/questions/9635968

Parameters

array $options: An associative array of options.

string $name: Option name with path delimited by period.

mixed $value: Option value.

1 call to TocFilter::setOption()
TocFilter::parseOptions in src/Plugin/Filter/TocFilter.php
Parse options from an attributes string.

File

src/Plugin/Filter/TocFilter.php, line 251
Contains \Drupal\toc_filter\Plugin\Filter\TocFilter.

Class

TocFilter
Provides a filter to display a table of contents.

Namespace

Drupal\toc_filter\Plugin\Filter

Code

protected static function setOption(array &$options, $name, $value) {
  $keys = explode('.', $name);
  while ($key = array_shift($keys)) {
    $options =& $options[$key];
  }
  $options = $value;
}