script() public method

If the filename is prefixed with "/", the path will be relative to the base path of your application. Otherwise, the path will be relative to your JavaScript path, usually webroot/js. ### Usage Include one script file: echo $this->Html->script('styles.js'); Include multiple script files: echo $this->Html->script(['one.js', 'two.js']); Add the script file to a custom block: $this->Html->script('styles.js', ['block' => 'bodyScript']); ### Options - block Set to true to append output to view block "script" or provide custom block name. - once Whether or not the script should be checked for uniqueness. If true scripts will only be included once, use false to allow the same script to be included more than once per request. - plugin False value will prevent parsing path as a plugin - fullBase If true the url will get a full address for the script file.
public script ( string | array $url, array $options = [] ) : string | null
$url string | array String or array of javascript files to include
$options array Array of options, and html attributes see above.
return string | null String of `