You are here

function slick in Slick Carousel 7.3

Same name and namespace in other branches
  1. 8.2 slick.module \slick()

Returns one of the Slick objects mainly used by procedural hooks.

Parameters

string $key: Identifier of the service.

Return value

class The required Slick class instance.

2 calls to slick()
slick_fields in slick_fields/slick_fields.module
Returns the slick fields object mainly used by procedural hooks.
slick_ui in slick_ui/slick_ui.module
Returns one of the slick service objects mainly used by procedural hooks.
22 string references to 'slick'
SlickAdmin::buildSettingsForm in src/Form/SlickAdmin.php
Returns the main form elements.
SlickCrudTest::setUp in tests/SlickCrudTest.test
Overrides DrupalWebTestCase::setUp.
SlickDefault::htmlSettings in src/SlickDefault.php
Returns HTML or layout related settings to shut up notices.
SlickFormatter::buildSettings in src/SlickFormatter.php
SlickFormatterBase::getScopedFormElements in src/Plugin/Field/FieldFormatter/SlickFormatterBase.php
Defines the scope for the form elements.

... See full list

File

./slick.module, line 22
Slick carousel integration, the last carousel you'll ever need.

Code

function slick($key = 'manager') {
  static $manager;
  static $formatter;
  static $library;
  if (!isset($manager)) {
    $manager = new SlickManager();
    $formatter = new SlickFormatter();
  }
  switch ($key) {
    case 'formatter':
      return $formatter;
    case 'library':
      if (!isset($library)) {
        $library = new SlickLibrary($manager);
      }
      return $library;
    default:
      return $manager;
  }
}