public registerScriptFile ( string $script = '', [type] $basePathAlias = null, [type] $priority = null, $output = self::OUTPUT_ALL, boolean $preRegister = true ) | ||
$script | string | The script path. Eg: 'js/script.js' |
$basePathAlias | [type] | |
$priority | [type] | |
$preRegister | boolean | Pre-register the asset (if set to false, priority and output will be ignored) |
public function registerScriptFile($script = '', $basePathAlias = null, $priority = null, $output = self::OUTPUT_ALL, $preRegister = true)
{
$priority = $priority !== null ? $priority : $this->jsPriority--;
$path = $this->createUrl($script, $basePathAlias, false);
if ($preRegister) {
$this->addOrderedScriptFile($path, $priority, $output);
} elseif ($this->canOutput($output)) {
$this->clientScript->registerScriptFile($path);
}
}