hello everyone…
i am trying to print Location name instead of id in my CDetailView but it’s printing $data->getLocatinName() same thing. i tried this code with CGridView there it’s working fine but here its printing something else.
My CDetail view Code…
<?php $this->widget(‘zii.widgets.CDetailView’, array(
'data'=>$model,
'attributes'=>array(
....
array('name'=>'CurrentLocation','value'=>'$data->getLocationName()'),
)))
in my model i am calling method getLocationName() code is…
public function getLocationName()
{
$query= Locations::model()->find("LocationId=$this->CurrentLocation");
$lname=$query['LocationName'];
return $lname;
}
Please Suggest how to print name?