drupal-twig-extensions
Version:
JavaScript implementation of Drupal’s Twig extensions
36 lines (34 loc) • 805 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.options = exports.name = exports.acceptedArguments = void 0;
/**
* @file The attach_library function
*
* Docs for TwigExtension::attachLibrary (Drupal 9.3.x):
*
* ```
* new TwigFunction('attach_library', [$this, 'attachLibrary'])
* ```
*
* ```
* Attaches an asset library to the template, and hence to the response.
*
* Allows Twig templates to attach asset libraries using
* @code
* {{ attach_library('extension/library_name') }}
* @endcode
*
* @param string $library
* An asset library.
* ```
*/
const name = 'attach_library';
exports.name = name;
const options = {};
exports.options = options;
const acceptedArguments = [{
name: 'library'
}];
exports.acceptedArguments = acceptedArguments;