You are here

class StickyManager in Sticky 8

Same name and namespace in other branches
  1. 2.0.x src/Manager/StickyManager.php \Drupal\sticky\Manager\StickyManager

Class StickyManager

@package Drupal\sticky\Manager.

Hierarchy

Expanded class hierarchy of StickyManager

1 string reference to 'StickyManager'
sticky.services.yml in ./sticky.services.yml
sticky.services.yml
1 service uses StickyManager
sticky.manager in ./sticky.services.yml
Drupal\sticky\Manager\StickyManager

File

src/Manager/StickyManager.php, line 12

Namespace

Drupal\sticky\Manager
View source
class StickyManager {
  protected $config;
  public function __construct(ConfigFactoryInterface $config) {
    $this->config = $config
      ->get('sticky.settings');
  }

  /**
   * Returns JS settings.
   * @return array
   */
  public function getJsSettings() {
    return [
      'selector' => $this->config
        ->get('selector'),
      'top_spacing' => $this->config
        ->get('top_spacing'),
      'bottom_spacing' => $this->config
        ->get('bottom_spacing'),
      'class_name' => $this->config
        ->get('class_name'),
      'wrapper_class_name' => $this->config
        ->get('wrapper_class_name'),
      'center' => $this->config
        ->get('center'),
      'get_width_from' => $this->config
        ->get('get_width_from'),
      'width_from_wrapper' => $this->config
        ->get('width_from_wrapper'),
      'responsive_width' => $this->config
        ->get('responsive_width'),
      'z_index' => $this->config
        ->get('z_index'),
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
StickyManager::$config protected property
StickyManager::getJsSettings public function Returns JS settings.
StickyManager::__construct public function