Dhara
Dhara

Reputation: 1481

CDetailView don't show properly Chtml::link's HTML data

i use Chtml::link in one CDetailView.

array(
                    'label'=>'Images',
                    'type'=>'html',
                    'value'=> CHtml::link('<i class="fa fa-tag"></i>','#',array('data-target'=>'#myModal','class'=>'tag','data-toggle'=>'modal')),
                ),

But html properly not generated. it only add few property like below

<a class="tag" href="#"><i class="fa fa-tag"></i></a>

How can i add all property?

Upvotes: -1

Views: 155

Answers (1)

Vishal Bareja
Vishal Bareja

Reputation: 128

array(
  'label'=>'Images',
  'type'=>'html',
  'value'=> CHtml::link('<i class="fa fa-tag"></i>','#',array('data-target'=>'#myModal','class'=>'tag','data-toggle'=>'modal')),
),

change 'type'=>'html', to 'type'=>'raw',

After changing the code its look like below block

array (
  'label' => 'Images',
  'type'  => 'raw',
  'value' => CHtml::link('<i class="fa fa-tag"></i>','#',array('data-target'=>'#myModal','class'=>'tag','data-toggle'=>'modal')),
),

Upvotes: 1

Related Questions