php - Yii: Reference to an other object -


how can change view.php code (as autogenerated gii of yii framework) show link object (with title , link), instead of simple numeric id?

<b><?php echo chtml::encode($data->getattributelabel('employee')); ?>:</b> <?php echo chtml::encode($data->employee); ?> <br /> 

i can findbypk , chtml::link, maybe there shorter way? please give me shortest code this.

assuming route view employee employee/view , name stored in name , id in id, shortest way code be:

chtml::link(chtml::encode($data->employee->name), array('employee/view', 'id' => $data->employee->id)); 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -