Add Option In Cbutton To Add Html Code Inside

Hi All. I was trying to insert this code inside a button, using the yii-bootstrap widget, but I couldn’t.

<i class="icon-envelope icon-white"></i>

The idea is to create a green button with the mail icon inside.

I’m using the yii-bootstrap widget BootGridView

I found an alternative using jquery to inject html, but I think it’s more cleaner to have the option directly inside the yii button code.

The piece of code that worked is

<?php $this->widget(‘bootstrap.widgets.BootGridView’, array(

'type'=&gt;'striped bordered condensed',


'id'=&gt;'ns-messages-grid',


'dataProvider'=&gt;&#036;model-&gt;searchByFilter(&#036;filter),


'filter'=&gt;&#036;model,


'columns'=&gt;array(

array(

		 'class'=&gt;'bootstrap.widgets.BootButtonColumn',


		'template' =&gt; '{answer}',


		'buttons'=&gt;array(


			'answer' =&gt; array(


				'label' =&gt; ' ' ,


				'options' =&gt; array('class' =&gt; 'btn btn-success papatel-icon-answer','title' =&gt; 'Answer') ,


				'url'=&gt;'Yii::app()-&gt;createUrl(&quot;nsMessages/answerMsgAjax&quot;, array(&quot;id&quot;=&gt;&#036;data-&gt;id))',


				'click' =&gt; 'function(evt){


					evt.preventDefault() ;


						answerMsg(&#036;(this).attr(&quot;href&quot;), &#036;(this).parent().parent().children(&quot;:nth-child(2)&quot;).text());


				}' ,


				'visible' =&gt; '&#33; is_object(&#036;data-&gt;responsesms)' ,


				


			),

<script>

$(’.papatel-icon-answer’).html(’<i class=“icon-envelope icon-white”></i>’) ;

</script>

The option to add html code inside cbutton could be available soon?

thanks.