Hello Larry. Thanks for taking the time to reply to my post!
Yes, I think that's it. Basically, the way I understand it, CActiveDataProvider in EmployeeController.php on line 126 gets the employee table as a whole and then passes it on to the index view.
$dataProvider=new CActiveDataProvider('Employee');
$this->render('index',array(
'dataProvider'=>$dataProvider,
));
Which in turn passes it on to the _view widget.
<?php $this->widget('zii.widgets.CListView', array(
'dataProvider'=>$dataProvider,
'itemView'=>'_view',
)); ?>
In _view.php the list of employees is generated. The information from $dataProvider is now in $data. And on lines 12 and 13 the departmentId is displayed.
<b><?php echo CHtml::encode($data->getAttributeLabel('departmentId')); ?>:</b>
<?php echo CHtml::encode($data->departmentId); ?>
I would like to lookup the department name and display that instead. Is there a way I can manipulate $dataProvider in the controller to include the departmentName (from the table department) instead of departmentId (from the table employee) - or in addition to it?