How do I insert the JS files that come with Yii?

I want to use the CTabView widget. I followed the example in this cookbook page but it doesn’t work right because the JavaScript and CSS are not being included.

How do I insert the JavaScript and CSS for the CTabView widget?

They are inserted automatically…

Hmm…  It works if all the tabs contain only text, but when one of the tabs points to a view, it stops working. The view in question has a form. Looking at the HTML produced, it looks like the '$form' variable is not set in and so the program dies when I reach CHtml::errorSummary($form). In turn, this leads me to think that CTabView is not running the controller.

Is there a way to make CTabView actually call the controller? In my final application, the contents of each tab will require non-trival SQL queries. I don't want to have to run all the queries at once so I can give all the data to CTabView to pass to the tabs.

Quote

Hmm...  It works if all the tabs contain only text, but when one of the tabs points to a view, it stops working. The view in question has a form. Looking at the HTML produced, it looks like the '$form' variable is not set in and so the program dies when I reach CHtml::errorSummary($form). In turn, this leads me to think that CTabView is not running the controller.

Is there a way to make CTabView actually call the controller? In my final application, the contents of each tab will require non-trival SQL queries. I don't want to have to run all the queries at once so I can give all the data to CTabView to pass to the tabs.

Be sure to check out the Yii cookbook often, read this:

http://www.yiiframew…doc/cookbook/5/

I linked to the same cookbook page in my first post. Has anything changed? It looks the same as before.

At any time, you can call a controller code in a view using Yii::app()->controller->method(). If the view is rendered by the controller, you can also use $this->method(), where $this would refer to the controller instance.