Charles Bao
Charles Bao

Reputation: 255

Yiibooster TbButton url link not work

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

Answers (2)

Mario di patria
Mario di patria

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

Ankita
Ankita

Reputation: 623

just replace your url to this:

'url'=>'http://www.baidu.com'

Upvotes: 0

Related Questions