I have one asset package (AppAsset) that is registered in my main layout (main.php) for shared assets for the entire application:
class AppAsset extends AssetBundle { public $basePath = '@webroot'; public $baseUrl = '@web'; public $css = [ 'css/style.css', ]; public $depends = [ 'yii\web\JqueryAsset', 'yii\bootstrap\BootstrapAsset', ]; }
But on one specific page (and not on the whole application!) I need to change my jquery to a lower version and connect other assets. And I register another asset package, which depends on the main AppAsset asset package in the desired file of the form:
class GalleryAsset extends AssetBundle { public $basePath = '@webroot'; public $baseUrl = '@web'; public $css = [ 'css/gamma/style.css', 'css/gamma/noJS.css', ]; public $js = [ 'js/gamma/modernizr.custom.70736.js', 'js/gamma/jquery.masonry.min.js', 'js/gamma/jquery.history.js', 'js/gamma/js-url.min.js', 'js/gamma/jquerypp.custom.js', 'js/gamma/gamma.js', ]; public $depends = [ 'app\assets\AppAsset', ]; }
The question is, how can I change the jQuery version in the GalleryAsset set of child assets or in one specific file (page)?
Thank you and God bless the helpers.
source share