public static function nav($data, $params = array())
    {
        $defParams = array(
            'active' => null,
            'parent' => 'ul',
            'child' => 'li',
            'parent@' => array('class' => 'nav'),
            'child@' => array(),
            'link@' => array()
        );

        $params = array_merge($defParams, $params);

        $html = '<' . $params['parent'] . ' ' . Html::attributes($params['parent@']) . '>';

        foreach ($data as $key => $value) {
            $html .= '<' . $params['child'] . ' ' . Html::attributes($params['child@']) . '>';
            $html .= '<a href="' . $value['link'] . '"' . Html::attributes($params['link@']) . '>' . $value['name'] . '</a>';
            $html .= '</' . $params['child'] . '>';
        }

        $html .= '</' . $params['parent'] . '>';

        return $html;
    }
public static function nav($data, $params = array())
    {
        $defParams = array(
            'active' => null,
            'parent' => 'ul',
            'child' => 'li',
            'parent@' => array('class' => 'nav'),
            'child@' => array(),
            'link@' => array()
        );

        $params = array_merge($defParams, $params);

        $html = '<' . $params['parent'] . ' ' . Html::attributes($params['parent@']) . '>';

        foreach ($data as $key => $value) {
            $html .= '<' . $params['child'] . ' ' . Html::attributes($params['child@']) . '>';
            $html .= '<a href="' . $value['link'] . '"' . Html::attributes($params['link@']) . '>' . $value['name'] . '</a>';
            $html .= '</' . $params['child'] . '>';
        }

        $html .= '</' . $params['parent'] . '>';

        return $html;
    }
public static function nav ( $ data , $ params = array ( ) ) { $ defParams = array ( 'active' => null , 'parent' => 'ul' , 'child' => 'li' , 'parent@' => array ( 'class' => 'nav' ) , 'child@' => array ( ) , 'link@' => array ( ) ) ; $ params = array_merge ( $ defParams , $ params ) ; $ html = '<' . $ params [ 'parent' ] . ' ' . Html :: attributes ( $ params [ 'parent@' ] ) . '>' ; foreach ( $ data as $ key => $ value ) { $ html .= '<' . $ params [ 'child' ] . ' ' . Html :: attributes ( $ params [ 'child@' ] ) . '>' ; $ html .= '<a href="' . $ value [ 'link' ] . '"' . Html :: attributes ( $ params [ 'link@' ] ) . '>' . $ value [ 'name' ] . '</a>' ; $ html .= '</' . $ params [ 'child' ] . '>' ; } $ html .= '</' . $ params [ 'parent' ] . '>' ; return $ html ; }
Navbar helper => generate a navbar helpers
@todo better navigation handler
Navbar helper = > generate a navbar helpers