[
'aria-label' => 'Toolbar with button groups',
],
'buttonGroups' => [
ButtonGroup::widget([
'options' => [
'aria-label' => 'First group',
'class' => ['mr-2'],
],
'buttons' => [
[
'label' => '1',
],
[
'label' => '2',
],
[
'label' => '3',
],
[
'label' => '4',
],
],
]),
[
'options' => [
'aria-label' => 'Second group',
],
'buttons' => [
[
'label' => '5',
],
[
'label' => '6',
],
[
'label' => '7',
],
],
],
],
]);
$expected = <<
HTML;
$this->assertEqualsWithoutLE($expected, $out);
}
public function testAdditionalContent()
{
ButtonToolbar::$counter = 0;
$addHtml = <<
HTML;
$out = ButtonToolbar::widget([
'options' => [
'aria-label' => 'Toolbar with button groups',
],
'buttonGroups' => [
[
'options' => [
'aria-label' => 'First group',
'class' => ['mr-2'],
],
'buttons' => [
[
'label' => '1',
],
[
'label' => '2',
],
[
'label' => '3',
],
[
'label' => '4',
],
],
],
$addHtml,
],
]);
$expected = <<
HTML;
$this->assertEqualsWithoutLE($expected, $out);
}
}