I’m new to Yii and would like to know, how I can include CSS into Yii?
I have to put up a web application for my University project and wrote some HTML and CSS code. It looked the way I wanted it and then I shifted it into my yii folder. Now I can’t see any pictures and every Change I do in the CSS file doesn’t work.
What am I doing wrong? Do I have to write something into the main.php or somewhere else?
By default, the asset files and directories are published only once. You should use CAssetManager::forceCopy or CAssetManager::linkAssets to edit this behavior.
Still doesn’t work and my english is not perfect so I don’t understand everything from the links you two gave me. Sadly I don’t get any answers on the german forum that’s why I’m really thankful that you try to help me
Files must be located in the CSS folder of the root directory, like this. Register a CSS file in a layout should implement that way. And if you will use CAssetManager for publishing asset files and directories (e.g. in module), look at this.
By the way, your code on the screenshot contains the error:
Maybe you have some problems with the configuration of the Web server. Try to install the demo blog from the demos directory of the last Yii release. If it works good, do the similar configuration for your application.