하나의 이미지 열로 결과를 표시하는 기록 코드가 있습니다. 어떻게 든 그것은 저에게 오류를주고 있습니다CGridView의 디스플레이 이미지 태그
나는 이런 식으로 코드를 작성했습니다.
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id' => 'photo-grid',
'dataProvider' => $model->search(),
//'filter' => $model,
'columns' => array(
'id',
array(
'name'=>'user_id',
'value'=>'GxHtml::valueEx($data->user)',
'filter'=>GxHtml::listDataEx(User::model()->findAllAttributes(null, true)),
),
array(
'name'=>'regulation_id',
'value'=>'GxHtml::valueEx($data->regulation)',
'filter'=>GxHtml::listDataEx(Regulation::model()->findAllAttributes(null, true)),
),
//'photo_img',
array(
'name' => 'Photo Img',
'type' => 'raw',
'value' => CHtml::image(Yii::app()->controller->createUrl('photo/loadImage', array('id'=>$model->id)),"",array('width'=>50, 'height'=>50)),
),
array(
'class' => 'CButtonColumn',
),
),
)); ?>
CGridView에서 이미지를 표시하는 방법을 도와 줄 수 있습니까?
오류 무엇인가? 왜 당신은''type '=>'raw ''라고 말했습니까? –
예 'type'=> 'raw'라고 작성했지만 구문 오류가 발생했습니다. \t 구문 오류, C : \ xampp \ htdocs \ pte \ framework \ base \ CComponent.php (607) : 예기치 않은 '<'코드 1 행 –
eval() 'd codeium pentium10이 올바르게 대답했다고 생각합니다. –