A
A
Anton2016-07-18 03:11:51
Yii
Anton, 2016-07-18 03:11:51

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

2 answer(s)
M
Maxim Fedorov, 2016-07-18
@qonand

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.

M
Maxim Timofeev, 2016-07-18
@webinar

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 question

Ask a Question

731 491 924 answers to any question