Log1x/navi

Nav setup

Closed this issue · 2 comments

If setting up multiple navs can this be adapted to return also a secondary nav eg. footer nav? So essentially, without the need to create separate php files for each nav?

    /**
     * Returns the primary navigation.
     *
     * @return array
     */
    public function navigation()
    {
        if (Navi::build('primary')->isEmpty()) {
            return;
        }
        
        return Navi::build('primary')->toArray();
    }
}
Log1x commented

You'd just create another method.

    /**
     * Returns the footer navigation.
     *
     * @return array
     */
    public function footerNav()
    {
        if (Navi::build('footer_navigation')->isEmpty()) {
            return;
        }
        
        return Navi::build('footer_navigation')->toArray();
    }

and then add 'footerNav' => $this->footerNav() to $with

That done the trick perfectly. Thanks 👍