Yii Render View Inside View


I heve question and some problem.

I have two model : Task and Project.

Project has relation:

 'tasks' => array(self::HAS_MANY, 'Task', 'project_id'),

I wanna render Task view in Project view. How to do it?

Take a look at renderPartial.

Yes, i used now in view project :

 <td><?php $this->renderPartial('//task/_view', array('data'=>$data)); ?></td>

but i returning me :

Property "Project.content" is not defined. 

Project :





Task :










foreach($data->tasks as $task) { echo $task->content . ‘<br/>’; }

Dear Friend

In views/project/view.php you can add the following .

<?php $this->widget('zii.widgets.CListView', array(

	'dataProvider'=>new CArrayDataProvider($model->tasks),


)); ?>