![](/img/trans.png)
[英]How to use link url in booster.widgets.TbButtonGroup of YiiBooster 4.x?
[英]Yiibooster TbButton url link not work
我想要按鈕鏈接到另一個網頁,我在查看文件中使用以下代碼:
$this->widget('booster.widgets.TbButton',array(
'context'=>'primary',
'label'=>'button',
'url'=>'www.baidu.com'
));
以及它生成的html如下:
<button class="btn btn-primary" id="yw2" name="yt0" type="button">button</button>
以下代碼有效,但顯示為字符串:
echo CHtml::link(CHtml::encode('button'),'www.baidu.com')
有人可以幫忙嗎?
這是解決方案:
$this->widget('booster.widgets.TbButton',array(
'context'=>'primary',
'label'=>'button',
'buttonType' =>'link',
'url'=>'href link XXXXXXX.com'
));
buttonType是解決方案。 它沒有文檔,只是閱讀API。
只需將您的網址替換為:
'url'=>' http://www.baidu.com '
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.