示例#1
0
 /**
  * Add a child menu item to this menu
  *
  * @param mixed   $child    An ioMenuItem object or the name of a new menu to create
  * @param string  $route    If creating a new menu, the route for that menu
  * @param string  $attributes  If creating a new menu, the attributes for that menu
  * @param string  $class    The class for menu item, if it needs to be created
  *
  * @return ioMenuItem The child menu item
  */
 public function addChild($child, $route = null, $attributes = array(), $class = null)
 {
     if (!$child instanceof ioMenuItem) {
         $child = $this->_createChild($child, $route, $attributes, $class);
     }
     parent::addChild($child);
     $child->setTree($this->getTree(), true);
     return $child;
 }