You are here

protected function PagererStyleBase::getOption in Pagerer 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/pagerer/PagererStyleBase.php \Drupal\pagerer\Plugin\pagerer\PagererStyleBase::getOption()

Returns a configuration element.

Parameters

string $key: The configuration element to return. Dots (.) will be interpreted as a nesting in the configuration array structure.

Return value

mixed The configuration element, or NULL if non existing.

14 calls to PagererStyleBase::getOption()
Adaptive::buildAdaptivePageList in src/Plugin/pagerer/Adaptive.php
Returns an array of pages using an adaptive logic.
Adaptive::buildPageList in src/Plugin/pagerer/Adaptive.php
Return an array of pages.
Mini::buildPagerItems in src/Plugin/pagerer/Mini.php
Return the pager render array.
PagererStyleBase::getDisplayTag in src/Plugin/pagerer/PagererStyleBase.php
Returns a translated textual element for pages/items/item ranges.
PagererStyleBase::getPageItem in src/Plugin/pagerer/PagererStyleBase.php
Gets a 'page' item in the pager.

... See full list

File

src/Plugin/pagerer/PagererStyleBase.php, line 478

Class

PagererStyleBase
Base plugin for Pagerer.

Namespace

Drupal\pagerer\Plugin\pagerer

Code

protected function getOption($key) {
  $keys = explode('.', $key);
  $n = $this->configuration;
  foreach ($keys as $k) {
    if (!empty($n[$k])) {
      if (is_array($n[$k])) {
        $n = $n[$k];
      }
      else {
        return $n[$k];
      }
    }
    else {
      return NULL;
    }
  }
}