Dropdowns See documentation
Creates a basic dropdown with simple items objects:
$dp = Html::dropdown();
$dp->item('#', 'home');
$dp->item('#', 'User');
$dp->item('#', 'Logout');
Call
divider() and / or header() methods to separates items into groups:
$dp->divider()
$dp->header('account')
You also can build nested dropdown with ease throught the
nest() item's method:
$dp = Html::dropdown();
$dp->item('#', 'action');
$dp->item('#', 'action');
$dp2 = Html::dropdown();
$dp2->item('#', 'home');
$dp2->item('#', 'nested')->nest($dp);
Integrate dropdown
Here, we create a dropdown contained in ali tag (default is div). Usefull for navs:
$dp = Html::dropdown('click to open me', array('container' => 'li'));
Dropdowns can also easily be integrated into tabs navigation. Don't set any text when building the dropdown: item will care:
$dp = Html::dropdown());
$dp->item('#', 'home', 'home');
$dp->item('#', 'User', 'user');
$tab = Html::navtab();
$tab->item('#', 'Classic tab')->active();
$tab->item('#', 'Dropdown tab')->dropdown($dp);