Yii framework – display image in detailview


widget('zii.widgets.CDetailView', array(
'data'=>$model,
'attributes'=>array(
array('name'=>'','type'=>'raw','value'=>CHtml::link(" Edit ",Yii::app()->baseUrl.'/user/update/'.$model->user_id)),
'user_id',
'first_name',
'last_name',
'password',
'email',
array(
'name'=>'image',
'type' => 'raw',
'value' => ((!empty($model->image))?html_entity_decode(CHtml::image(Yii::app()->baseUrl . "/uploads/user/" . $model->image,"User Image",array("width"=>200))):"No Image")

),
),
)); ?>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s