public function addJS($file, $minify = true, $addTimestamp = null, $priorityGroup = self::PRIORITY_GROUP_DEFAULT)
{
$file = (string) $file;
$minify = (bool) $minify;
$addTimestamp = (bool) $addTimestamp;
// get file path
if (mb_substr($file, 0, 4) != 'http') {
$file = Theme::getPath($file);
}
// no minifying when debugging
if ($this->getContainer()->getParameter('kernel.debug')) {
$minify = false;
}
if ($minify) {
$file = $this->minifyJS($file);
}
$jsFile = array('file' => $file, 'add_timestamp' => $addTimestamp, 'priority_group' => $priorityGroup);
// only add when not already in array
if (!isset($this->jsFiles[$file])) {
$this->jsFiles[$file] = $jsFile;
}
}