0

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.

Kai
  • 38,985
  • 14
  • 88
  • 103

1 Answers1

0

This will not be supported by Yii. You can find the official statement here:

https://code.google.com/p/yii/issues/detail?id=1240#c21

Michael Härtl
  • 8,428
  • 5
  • 35
  • 62