You are here

public function SlickManager::slick in Slick Carousel 8.2

Same name and namespace in other branches
  1. 8 src/SlickManager.php \Drupal\slick\SlickManager::slick()
  2. 7.3 src/SlickManager.php \Drupal\slick\SlickManager::slick()

Returns a cacheable renderable array of a single slick instance.

Parameters

array $build: An associative array containing:

  • items: An array of slick contents: text, image or media.
  • options: An array of key:value pairs of custom JS overrides.
  • optionset: The cached optionset object to avoid multiple invocations.
  • settings: An array of key:value pairs of HTML/layout related settings.

Return value

array The cacheable renderable array of a slick instance, or empty array.

Overrides SlickManagerInterface::slick

2 calls to SlickManager::slick()
SlickManager::buildNavigation in src/SlickManager.php
Returns slick navigation with the structured array similar to main display.
SlickManager::preRenderSlickWrapper in src/SlickManager.php
One slick_theme() to serve multiple displays: main, overlay, thumbnail.

File

src/SlickManager.php, line 69

Class

SlickManager
Implements BlazyManagerInterface, SlickManagerInterface.

Namespace

Drupal\slick

Code

public function slick(array $build = []) {
  foreach (SlickDefault::themeProperties() as $key) {
    $build[$key] = isset($build[$key]) ? $build[$key] : [];
  }
  return empty($build['items']) ? [] : [
    '#theme' => 'slick',
    '#items' => [],
    '#build' => $build,
    '#pre_render' => [
      [
        $this,
        'preRenderSlick',
      ],
    ],
  ];
}