Agile UI
doc-spellcheck
  • Overview of Agile UI
  • Quickstart
  • Core Concepts
  • Components
  • JavaScript Mapping
  • Advanced Topics
Agile UI
  • Docs »
  • Menu
  • Edit on GitHub

Menu¶

class atk4\ui\Menu¶

Menu implements horizontal or vertical multi-level menu by using Semantic UI’s ‘menu’.

Using Menu¶

Here is a simple usage:

$menu = $app->add('Menu');
$menu->addItem('foo');
$menu->addItem('bar');

to make menu vertical:

$menu->addClass('vertical');

Decorating Menu Items¶

See Item for more options:

$menu->addItem(['foo', 'icon'=>'book']);

Specifying Links and Actions¶

Menu items can use links and actions:

$menu->addItem('foo', 'test.php');
$menu->addItem('bar', new jsModal('Test'));

Creating sub-menus¶

You can create sub-menu for either vertical or horizontal menu. For a vertical menu you can also use groups. For horizontal menu, you can use addRightMenu.

$menu = $app->add('Menu');
$menu->addItem('foo');
$sub = $menu->addMenu('Some Bars');
$sub->addItem('bar 1');
$sub->addItem('bar 2');

Headers¶

Advanced Use¶

You can add other elements inside menu. Refer to demos/menu.php.

Item¶

class atk4\ui\Item¶
property atk4\ui\Item::$$label¶

Additionally you can use View::addClass() to disable or style your menu items.


© Copyright 2016-2017, Agile Toolkit. Revision 180e0d64.

Built with Sphinx using a theme provided by Read the Docs.