Hi,
I have two tables: user table with user_id and username (amongst other fields). The other table is project which contains project_id, manager_id and description.
I able to change the update view, so it gives me a dropdownlist with the user names (and save this with the user_id being the manager_id in the project table).
However on the views/project/view.php I still have the manager id showing up.
What is the best way forward:
Change the view.php to contain something like
<?php $this->widget('zii.widgets.CDetailView', array(
'data'=>$model,
'attributes'=>array(
'project_id',
'searchname',
'manager_id',
array(
'label'=>'Manager name',
'value'=>'The name of the manager to retrieve from user table'
),
'description',
),
)); ?>
or a change to the protected/controllers/ProjectController.php in function actionView?
If the change to the actionView is best (performance and best in line with MVC) how to implement that?
Thanks in advance,
Duketown
PS. I didn’t build in a relation between the tables at SQL level.