You are here

public function BootstrapLayout::setSetting in Bootstrap Layouts 8.4

Same name and namespace in other branches
  1. 8.5 src/BootstrapLayout.php \Drupal\bootstrap_layouts\BootstrapLayout::setSetting()

Sets a specific layout setting.

Parameters

string $name: The layout setting name. Can be dot notation to indicate a deeper key in the settings array.

mixed $value: The layout setting value.

Return value

\Drupal\bootstrap_layouts\BootstrapLayout The current BootstrapLayout instance.

File

src/BootstrapLayout.php, line 205

Class

BootstrapLayout
Class BootstrapLayout.

Namespace

Drupal\bootstrap_layouts

Code

public function setSetting($name, $value = NULL) {
  $parts = explode('.', $name);
  if (count($parts) === 1) {
    $this->data['settings'][$name] = $value;
  }
  else {
    NestedArray::setValue($this->data['settings'], $parts, $value);
  }
  return $this;
}