Answer the question
In order to leave comments, you need to log in
Module and AssetBundle?
Good day and night. I have a module and I want my css and js files to be in the folder with the module, it turns out that in order to connect them in views, you need to create your own AssetBundle class, and if you write a lot of css and js files in this class, they will be connected in each view is it possible how to get around this without writing a bunch of AssetBundle classes for each view?
Answer the question
In order to leave comments, you need to log in
There are no built-in features in Yii to implement this, if each page needs its own set of resources, each of them must have its own AssetBundle. Of course, you can somehow modify the AssetBundle so that, depending on the page, it changes the list of js and css, but from an architectural point of view, this will not be correct.
As an option. Write a widget, connect it in it, connect it on all pages of the module.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question