how to use assets ???

is there a guide line on how to use assets?

i can`t figure out how to change the design of them, without modifing them in the zii

thanks in advance:)

What is your need?

assets folder is automatically populated by different parts of Yii…

for example for CListView i want to modify the css for the pages

how can i make it not load the default css and to load only the one i made

how can i make sure a file is loaded only once, for example js??

i understand that assets are used to bring js, css and images to the public directory

For CListView you can use the cssFile property -

and put your CSS file for example in

Sorry for using this old post but is exactly my problem.

I’d like to change the bg.gif (table header bg) for all the CGridViews I use , I am changing root/css/bg.gif but nothing happens, I need to change the assets/number/gridview/bg.gif to get it changed.

How should I do it?

CGridView has it’s own default CSS file where the bg.gif is set for the background… this file is copyed to the assets folder… so you cannot change it there…

take a look at the default CSS file for the CGridView… and create a custom one…

the default CSS file is in Yii root folder /framework/zii/widgets/assets/gridview/styles.css

NOTE: it’s a bad practice to change framework files… .so you need to create a custom one… .and use the cssFile property -


I am new to YII, and had the similar query.

I want to use js file from assets folder(right now fancybox js).

pls can you tell me how can i do this??

Thanks and regards