Reputation: 255
i want the button link to another web page, i'm using following code in my view file:
$this->widget('booster.widgets.TbButton',array(
'context'=>'primary',
'label'=>'button',
'url'=>'www.baidu.com'
));
and the html it generated as following:
<button class="btn btn-primary" id="yw2" name="yt0" type="button">button</button>
the following code worked but show as a string:
echo CHtml::link(CHtml::encode('button'),'www.baidu.com')
anyone can help?
Upvotes: 2
Views: 3351
Reputation: 61
here is the solution:
$this->widget('booster.widgets.TbButton',array(
'context'=>'primary',
'label'=>'button',
'buttonType' =>'link',
'url'=>'href link XXXXXXX.com'
));
buttonType is the solution. It's not documented , just reading API.... bye
Upvotes: 6