You are here

public function RenderStack::drupal_add_library in Render cache 7.2

Helper function to add library assets to the recursion storage.

Parameters

$module: The name of the module that registered the library.

$name: The name of the library to add.

$every_page: Set to TRUE if this library is added to every page on the site. Only items with the every_page flag set to TRUE can participate in aggregation.

Return value

TRUE if the library was successfully added; FALSE if the library or one of its dependencies could not be added.

See also

drupal_add_library()

File

src/Cache/RenderStack.php, line 446
Contains \Drupal\render_cache\Cache\RenderStack

Class

RenderStack
Defines the RenderStack service.

Namespace

Drupal\render_cache\Cache

Code

public function drupal_add_library($module, $name, $every_page = NULL) {
  if ($this
    ->isRecursive()) {
    $storage = array();
    $storage['#attached']['library'][] = array(
      $module,
      $name,
    );
    $this
      ->addRecursionStorage($storage, TRUE);

    // @todo Figure out at runtime if library dependencies are met.
    return TRUE;
  }
  return $this
    ->callOriginalFunction("drupal_add_library", $module, $name, $every_page);
}