E
E
EVOSandru62015-07-20 09:43:25
Yii
EVOSandru6, 2015-07-20 09:43:25

How to put glyth bootstrap in button in yii?

This trick works:

echo CHtml::htmlButton('<span class="glyphicon glyphicon-search"></span>',
                ["class"=>"btn btn-default", 'type'=>'submit', 'name'=>'yt0']);

I would like it in this format:
echo CHtml::SubmitButton('<span class="glyphicon glyphicon-search"></span>',
                ["class"=>"btn btn-default"]);

Or in this one:
echo CHtml::SubmitButton(CHtml::tag('span',['class'=>'glyphicon glyphicon-search'],'',true),
                ["class"=>"btn btn-default"]);

But the output is just the text on the button:

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Makarov, 2015-07-20
@EVOSandru6

CHtml::submitButton('<strong>test</strong>', ['encode' => false]);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question