I want to properly include my assets in my application, but I don’t get the difference between CHtml->cssFile() and CClientScript->registerCssFile().
I understand that the CClientScript methods allow to compress assets in a single one. But is that all ?
Can someone explain me what is the real advantage to use one or the other ? And in which situation ?
Is CClientScript using the CHtml methods to render the tags ?
Thanks a lot !
Thanks a lot Joblo !
I understand now that you can add a script from anywhere in the code with CClientScript. And that’s a great solution !
One last question : What is the right solution to display assets that are not in widget or other ? (Assets that are in the layout and unique for the application)
Is it to use Chtml or CClientScript ?
Then keep it simple, and use regular html <link> and <script> tags in your layout. I can’t see any benefit of using clientScript here. (It doesn’t combine/compress/minify assets.)