Skip to content

Commit

Permalink
Changed BootMenu to support the 'id' parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
bramp committed May 19, 2012
1 parent d5db49a commit 0bdc9be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion widgets/BootBaseMenu.php
Expand Up @@ -26,14 +26,18 @@ abstract class BootBaseMenu extends CWidget
*/
public $htmlOptions = array();

public function init() {
$this->htmlOptions['id']=$this->getId();
}

/**
* Runs the widget.
*/
public function run()
{
echo CHtml::openTag('ul', $this->htmlOptions);
$this->renderItems($this->items);
echo '</ul>';
echo CHtml::closeTag('ul');
}

/**
Expand Down
2 changes: 2 additions & 0 deletions widgets/BootMenu.php
Expand Up @@ -45,6 +45,8 @@ class BootMenu extends BootBaseMenu
*/
public function init()
{
parent::init();

$route = $this->controller->getRoute();
$this->items = $this->normalizeItems($this->items, $route);

Expand Down

0 comments on commit 0bdc9be

Please sign in to comment.