This will not be supported by Yii. You can find the official statement here:
clientScript package with conditional comment
-
11-04-2022 - |
Question
Having searched around quite a bit to no avail I'm wondering if there is a way to assign JS and CSS files to a package with a conditional statement (i.e. <!--[if lte ie 7]>
).
I would want something like this:
$packages['my-package'] = array(
'basePath'=>'path.to.my-package',
'css'=>array('css/style.css'),
'js'=>array('js/file-to-load-conditionally.js'=>'<!--[if lte ie 7]>%s<![endif]-->')
);
foreach ($packages as $name => $package):
Yii::app()->clientScript->addPackage($name, $package);
endforeach;
Is this already implemented, is about to be or does anyone know of another way to solve this issue?
Thanks in advance.
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow