You are here

public function SitemapHelper::setOption in Sitemap 8

Sets options based on admin input parameters for rendering.

Parameters

array $options: The array of options to the sitemap theme.

string $option_string: The string index given from the admin form to match.

int $equal_param: Result of param test, 0 or 1.

string $set_string: Index of option to set, or the option name.

bool $set_value: The option, on or off, or strings or ints for other options.

2 calls to SitemapHelper::setOption()
SitemapHelper::getTaxonomyTree in src/SitemapHelper.php
Render the taxonomy tree.
SitemapHelper::getTerms in src/SitemapHelper.php
Render the latest maps for the taxonomy tree.

File

src/SitemapHelper.php, line 82

Class

SitemapHelper
Defines a helper class for stuff related to views data.

Namespace

Drupal\sitemap

Code

public function setOption(array &$options, $option_string, $equal_param, $set_string, $set_value) {
  $config = $this->configFactory
    ->get('sitemap.settings');
  if ($config
    ->get($option_string) == $equal_param) {
    $options[$set_string] = $set_value;
  }
}