/** * Render the nav object * * @param boolean $ret * @return mixed */ public function render($ret = false) { if (null === $this->nav) { $this->nav = $this->traverse($this->tree); } if ($ret) { return $this->nav->hasChildren() ? $this->nav->render($ret) : ''; } else { echo $this->nav->hasChildren() ? $this->nav->render($ret) : ''; } }