/var/www/agiletoolkit.org/_/codepad/atk4/lib/View/Popover.php:59 [2] Invalid argument supplied for foreach()
Agile Toolkit

Button Set Example

Creates multiple buttons without gaps.

Example 1
SOURCE

$buttons = $page->add('ButtonSet');
$buttons->addButton('Test');
$buttons->addButton('Alert')
    ->js('click')
    ->univ()
    ->alert('BINGOOO!');
$buttons->addButton('With Icon')
    ->setIcon('ui-icon-star');

  
Demo
Example 2 vertical
SOURCE

$buttons = $page->add('ButtonSet',array('vertical'=>true));
$buttons->addButton()->setNoText('ui-icon-star');
$buttons->addButton()->setNoText('ui-icon-trash');
$buttons->addButton()->setNoText('ui-icon-pencil');

  
Demo

Drop buttons introduces a arrow at the end of the button, which is a visual que for a user that it will produce some popover. Anything can be inside that popover.

SOURCE

$button = $page->add('View_Button');
$popover = $form = $button->addPopover(array('width'=>'500'));

$popover->add('LoremIpsum',array('paragraphs'=>1,'words'=>50));

$buttons = $popover->add('ButtonSet');

$buttons->addButton('Alert')
    ->js('click')
    ->univ()
    ->alert('BINGOOO!');

$buttons->addButton('Close')
    ->js('click', $popover->js()->dialog('close'));

  
Demo

While adding rectangular things is fine like that, drop-down menus with submenus do not fit in this well. So there is a separate method:

SOURCE

$button = $page->add('View_Button');
$form = $button->addSplitButton()->addPopover()->add('Form');
$form->addClass('stacked');
$form->addField('Slider','volume');

  
Demo
SOURCE

$button = $page->add('View_Button');
$menu = $button->addMenu();

$menu->addMenuItem('one');
$menu->addMenuItem('two');
$sm = $menu->addSubMenu('submenu');
$menu->addMenuItem('three');
$menu->addMenuItem('four');

$sm -> addMenuItem('half');
$sm -> addMenuItem('quarter');

  
Demo
Example 3 Button with Menu (Split button dropdowns)
SOURCE

/*
$tb = $page->add('View_ButtonMenuButton')->set('Test');
$menu = $tb->addButtonMenu()->setType('vertical');
$menu->addMenuItem('open','Open...')
    ->addMenuItem('save','Save')
    ->sub()
        ->addMenuItem('saveas','Save as...')
    ->end()
    ->addMenuItem('delete','Delete')
;
*/

  
Demo
The example was executed successfully, but did not produce any output