<?php $path = Yii::app()->baseUrl."/uploads/"; ?> // First we have to Declare the path before the attaching the filename in the link this is the key step.
/* then after we can defile the attribute as follows */
<?php $this->widget('zii.widgets.CDetailView', array(
'data'=>$model,
'attributes'=>array(
'lan_no',
array(
'label' => 'Uploaded Image',
'type'=>'raw',
'value' => CHtml::link(CHtml::encode($model->image), $path .$model->image,array("target"=>"_blank"))
),
'man_code',
'vil_code',
'loc_name',
'sur_no',
'tsno',
'blo_name',
'nala_rem',
),
)); ?>
That's it if you want you can remove the target="_blank" option
/* then after we can defile the attribute as follows */
<?php $this->widget('zii.widgets.CDetailView', array(
'data'=>$model,
'attributes'=>array(
'lan_no',
array(
'label' => 'Uploaded Image',
'type'=>'raw',
'value' => CHtml::link(CHtml::encode($model->image), $path .$model->image,array("target"=>"_blank"))
),
'man_code',
'vil_code',
'loc_name',
'sur_no',
'tsno',
'blo_name',
'nala_rem',
),
)); ?>
That's it if you want you can remove the target="_blank" option
No comments:
Post a Comment