Embedding a view from another module

I wish to add the index action and the create action from my Comments module to the View action of my Event module (in essence display an event and then list its associated comments and allow new ones to be added. Can this be done easily? I have run into trouble because the model for comments is not instantiated when I am including the views.

Is not a good practice to use a view in different controller.

If you want to reuse view code among controllers, create a widget.

Ahh Ok … I figured as much. I have only just started with yii so I am still finding me feet but I will take the widget approach and see how I get on.


You are welcome.

Also, welcome to the forum! About widgets I guess there are lot of thread in wich we discuss how to make it.