i have index function in my controller
rendering something like that
$this->render(‘index’, array(
'model' => $model,
'notes' => $notes
));
//======CListView Like That=============
$this->widget(‘bootstrap.widgets.TbListView’, array(
'dataProvider'=>$model->search(),
'notes' => $notes ,
'itemView'=>'_view',
));
//===============================
passing notes as a extra parameter
how i get notes my render _view files is
// GETTING EROOR ( Property "TbListView.notes" is not defined. )
//==============_view files is under ======
<div class="view">
<b><strong> <?php echo CHtml::encode($data->getAttributeLabel('name')); ?></strong>:</b>
<?php echo CHtml::encode($data->name); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('start_date')); ?>:</b>
<?php echo CHtml::encode($data->start_date); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('end_date')); ?>:</b>
<?php echo CHtml::encode($data->end_date); ?>
<br />
<h5>Notes</h5>
<?php
print_r($notes);exit;
$criteria = new CDbCriteria();
$criteria->limit = '1';
$criteria->order = 'created_at DESC';
$note = Notes::model()->findAllByAttributes(array(
'parent_id' => $data->id,
'parent_type' => "Projects"
), $criteria
);
foreach ($note as $note) {
echo $note->description;
}
?>
<hr>
</div>