- $action: action being executed (for output and params)
- $items: array of items in the nav
+EndSubMenu: After outputting a submenu (including enclosing tags) to HTML
+- $out: HTMLOutputter used to output (usually an Action, but not always!)
+- $menu: The Menu object outputted as a submenu.
+- $label: Localized text which represents the menu item.
+
+StartSubMenu: Before outputting a submenu (including enclosing tags) to HTML
+- $out: HTMLOutputter used to output (usually an Action, but not always!)
+- $menu: The Menu object outputted as a submenu.
+- $label: Localized text which represents the menu item.
function submenu($label, $menu)
{
- if (empty($menu->getItems())){
- return false;
+ if (Event::handle('StartSubMenu', array($this->action, $menu, $label))) {
+ $this->action->elementStart('li');
+ $this->action->element('h3', null, $label);
+ $menu->show();
+ $this->action->elementEnd('li');
+ Event::handle('EndSubMenu', array($this->action, $menu, $label));
}
- $this->action->elementStart('li');
- $this->action->element('h3', null, $label);
- $menu->show();
- $this->action->elementEnd('li');
}
}