2

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?

lin
  • 17,956
  • 4
  • 59
  • 83
Charles Bao
  • 255
  • 1
  • 5
  • 16

2 Answers2

6

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

0

just replace your url to this:

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

Ankita
  • 621
  • 2
  • 9
  • 25