Nav setup
dottd-admin opened this issue · 2 comments
dottd-admin commented
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
dottd-admin commented
That done the trick perfectly. Thanks 👍