Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to create sub menu in sub menu? #7

Closed
thearabbit opened this issue May 31, 2014 · 1 comment
Closed

how to create sub menu in sub menu? #7

thearabbit opened this issue May 31, 2014 · 1 comment

Comments

@thearabbit
Copy link

I want to create sub menu in sub menu.
Pm help me.

@lavary
Copy link
Owner

lavary commented May 31, 2014

You can call add() method on each item:

<?php
Menu::make('mainNav', function($menu) {
   $about = $menu->add('About', 'about');
   $level1 = $about->add('Level1', 'level-2-url');
      $level2 = $level1->add('Level2', 'level-2-url');
          $level3 = $level2->add('Level3', 'level-3-url'); 
});
?>

You can also chain add() methods and go as deep as you need:

<?php
Menu::make('mainNav', function($menu){
    $menu->add('About', 'about')
               ->add('level1', 'level-1-url')
                  ->add('level2', 'level-2-url')
                     ->add('level3', 'level-3-url');
});
?>

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants