简介


yii2 bootstrap组件,按钮组(ButtonGroup)的实例演示如下


实例


<?php
use yii\bootstrap\ButtonGroup;
use yii\bootstrap\Button;
 
// a button group with items configuration
echo ButtonGroup::widget([
  'buttons' => [
      ['label' => '按钮A'],
      ['label' => '按钮B'],
      ['label' => '隐藏按钮C', 'visible' => false],
  ]
]);
// button group with an item as a string
echo ButtonGroup::widget([
  'buttons' => [
      Button::widget(['label' => '按钮A']),
      ['label' => '按钮B'],
  ]
]);


演示