CClientScript RenderHead

I don’t get it. Why do i need to pass any kind of output to the method? Why can’t it just output the registered scripts/css/meta tags as it should. Any example of the usage for this function? What kind of output do i pass into it?



CClientScript::renderHead() is used by CClientScript::render() which is used by CController::render() so that CClientScript can insert necessary script tags inside the head and/or body element. I don’t see a need for calling this method manually. The framework should handle all your registered assets for you (everything you have registered with CClientScript::register* methods).

So how do i print all the registered CSS/JS files i added? I don’t need to call anything to do that? Or what? Could you show an example?


Ok figured this out eventually.