W3cubDocs

/Drupal 8

function drupal_js_defaults

drupal_js_defaults($data = NULL)

Constructs an array of the defaults that are used for JavaScript assets.

Parameters

$data: (optional) The default data parameter for the JavaScript asset array.

See also

hook_js_alter()

File

core/includes/common.inc, line 435
Common functions that many Drupal modules will need to reference.

Code

function drupal_js_defaults($data = NULL) {
  return array(
    'type' => 'file',
    'group' => JS_DEFAULT,
    'weight' => 0,
    'scope' => 'header',
    'cache' => TRUE,
    'preprocess' => TRUE,
    'attributes' => array(),
    'version' => NULL,
    'data' => $data,
    'browsers' => array(),
  );
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!includes!common.inc/function/drupal_js_defaults/8.1.x