This is in project controller:
public function actionView($id)
{
$this->render('view',array('model'=>$this->loadModel($id),));
$issueDataProvider=new CActiveDataProvider('Issue', array(
'criteria'=>array(
'condition'=>'project_id=:projectId',
'params'=>array(':projectId'=>$this->loadModel($id)->id),
),
'pagination'=>array(
'pageSize'=>1,
), ));
$this->render('view',array(
'model'=>$this->loadModel($id),
'issueDataProvider'=>$issueDataProvider,
));
}
This is in /protected/views/project/view.php:
<br>
<h1>Project Issues</h1>
<?php $this->widget(‘zii.widgets.CListView’, array(
'dataProvider'=>$issueDataProvider,
'itemView'=>'/issue/_view',
)); ?>
And this is in /protected/views/issue/_view. php
<div class="view">
<b><?php echo CHtml::encode($data->getAttributeLabel(‘name’)); ?>:</b>
<?php echo CHtml::link(CHtml::encode($data->name), array(‘issue/ view’, ‘id’=>$data->id)); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel(‘descripti on’)); ?>:</b>
<?php echo CHtml::encode($data->description); ?> <br />
<b><?php echo CHtml::encode($data->getAttributeLabel(‘type_ id’)); ?>:</b>
<?php echo CHtml::encode($data->type_id); ?> <br />
<b><?php echo CHtml::encode($data->getAttributeLabel(‘status_ id’)); ?:</b>
<?php echo CHtml::encode($data->status_id); ?> </div>
What am I missing?