Enqueues javascript.

Uses default.js.pipeline, plugin.js.pipeline and theme.js.pipeline filter hooks.

Example Usage:

 cms_enqueue_js('default', 'jquery-ui')
 cms_enqueue_js('plugin', 'select2-js', false, Plugin::basename( dirname(__FILE__) ))
 cms_enqueue_js('theme', 'theme-slug/assets/js/config.js')

  • Full name: cms_enqueue_js
  • Defined in: cms/core/Shared/Helpers/core.php

Parameters

Parameter Type Description
$config string Set whether to use default, plugin or theme config.
$asset string|array Relative path or URL to JavaScript(s) to enqueue.
$minify bool|string Enable js assets pipeline (concatenation and minification).
Use a string that evaluates to true to provide the salt of the pipeline hash.
Use 'auto' to automatically calculate the salt from your assets last modification time.
$slug string|null Slug to set asset location.

Return Value

void