abstraction for starting and ending a menu

This commit is contained in:
Evan Prodromou 2011-03-07 12:36:45 -05:00
parent 876c7a42c8
commit b4f1281799
1 changed files with 17 additions and 0 deletions

View File

@ -62,6 +62,23 @@ class Menu extends Widget
$this->actionName = $action->trimmed('action');
}
function id()
{
return 'unknown_menu';
}
function menuStart()
{
$this->action->elementStart('div', array('id' => $this->id()));
$this->action->elementStart('ul', array('class' => 'nav'));
}
function menuEnd()
{
$this->action->elementEnd('ul');
$this->action->elementEnd('div');
}
function item($actionName, $args, $label, $description, $id=null)
{
if (empty($id)) {