YiiBooster
YiiBooster copied to clipboard
TbPanel with one single button
Hi, I tried to create a TbPanel with a single button with a url:
$this->beginWidget('booster.widgets.TbPanel', array( 'title' => 'SomeTitle', 'headerButtons' => array( array( 'class' => 'booster.widgets.TbButton', 'label' => 'Neu', 'context' => 'primary', 'size' => 'small', 'url' => '/someurl', ), ) ) )
With this code I get blue button, but w/o a link. If I add buttonType, I get a link, but it is no longer a blue button.
$this->beginWidget('booster.widgets.TbPanel', array( 'title' => 'SomeTitle', 'headerButtons' => array( array( 'class' => 'booster.widgets.TbButton', 'label' => 'Neu', 'context' => 'primary', 'size' => 'small', 'buttonType' =>'link', 'url' => '/someurl', ), ) ) )
Is this a bug or a feature?
This is an old question but someone might have the same problem and find this answer helpful:
$this->beginWidget('booster.widgets.TbPanel',
array(
'title' => 'SomeTitle',
'headerButtons' => array(
array(
'class' => 'booster.widgets.TbButton',
'label' => 'Neu',
'context' => 'primary',
'size' => 'small',
'htmlOptions'=>array(
'submit' => Yii::app()->createUrl('controller/action')
)
),
)
)
)