public function render(array $tree, $level = 0)
    {
        $output = '';

        foreach ($tree as $label => $next)
        {

            if (is_string($next))
            {
                $label = $next;
            }

            // Output the label
            $output .= sprintf("%s- %s\n", str_repeat(' ', $level * $this->_padding), $label);

            // Next level
            if (is_array($next))
            {
                $output .= $this->render($next, $level + 1);
            }

        }

        return $output;
    }
public function render(array $tree, $level = 0)
    {
        $output = '';

        foreach ($tree as $label => $next)
        {

            if (is_string($next))
            {
                $label = $next;
            }

            // Output the label
            $output .= sprintf("%s- %s\n", str_repeat(' ', $level * $this->_padding), $label);

            // Next level
            if (is_array($next))
            {
                $output .= $this->render($next, $level + 1);
            }

        }

        return $output;
    }
public function render ( array $ tree , $ level = 0 ) { $ output = '' ; foreach ( $ tree as $ label => $ next ) { if ( is_string ( $ next ) ) { $ label = $ next ; } // Output the label $ output .= sprintf ( "%s- %s\n" , str_repeat ( ' ' , $ level * $ this -> _padding ) , $ label ) ; // Next level if ( is_array ( $ next ) ) { $ output .= $ this -> render ( $ next , $ level + 1 ) ; } } return $ output ; }
Renders the tree

@param array $tree
@param int $level Optional
@return string
Renders the tree