Posts Tagged with data attribute

Displaying 1-1 of 1 result.
Resolved: Yii CGridView custom column not and not show html data attribute
posted by admin on April 24, 2016

echo CHtml::link(
CHtml::image(Yii::app()->request->baseUrl.'/images/op-create.png', "image", array("width"=>30)),
Yii::app()->request->baseUrl.'/images/op-create.png',
array("class"=>"highslide", 'rel'=>'myrel'));

output :

<a class="highslide" rel="myrel" href="/web/images/op-create.png"><img width="30" src="/web/images/op-create.png" alt="image" /></a>



$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'loc-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
array('name'=>'loc_picture',
'type'=>'html',
'header'=>'Picture',
'value'=> 'CHtml::link(CHtml::image(Yii::app()->request->baseUrl.$data->loc_picture, "image", array("width"=>30)), Yii::app()->request->baseUrl.$data->loc_picture, array("class"=>"highslide", \'rel\'=>\'myrel\'))',
'htmlOptions'=>array('width'=>'40','style'=>'text-align:center;'),
),
),
));

output :

<a class="highslide" href="/web/pictures/noimage.jpg"><img width="30" src="/web/pictures/noimage.jpg" alt="image" />

Why output in CGridView, REL="myrel" not shown???Read more