Giter Club home page Giter Club logo

Comments (8)

kaidesu avatar kaidesu commented on June 14, 2024

Sorry, looks like I forgot to write the documentation on this! It's simple though:

Creating our initial menu:

Menu::make('example', function($menu) {
    $menu->add('Link 1', '/link-1');
    $menu->add('Link 2', '/link-2);
});

Somewhere else (in a controller, for instance):

$menu = Menu::get('example');

$menu->add('Link 3', '/link-3');
$menu->add('Link 4', '/link-4');

from menus.

 avatar commented on June 14, 2024

And from an service provider? It's possible ?

from menus.

 avatar commented on June 14, 2024

Background:

I've use the Skylabs Module Plugin and each modules should have the possibilty to register a menu point. The menu service provider is located in Core Module.

from menus.

 avatar commented on June 14, 2024

Current value is "null". Within the Controller all okay.

from menus.

kaidesu avatar kaidesu commented on June 14, 2024

Yes, that is certainly possible (and the best location, imho)! Just be sure that your menu is created before trying to get() it and add items to it.

from menus.

 avatar commented on June 14, 2024

Okay, it’s functional.

How can I use sub menu points ?

Von: Shea Lewis [mailto:[email protected]]
Gesendet: Donnerstag, 30. April 2015 01:33
An: caffeinated/menus
Cc: virtualstep
Betreff: Re: [menus] Add new item from controller (#27)

Yes, that is certainly possible (and the best location, imho)! Just be sure that your menu is created before trying to get() it and add items to it.

β€”
Reply to this email directly or view it on GitHub #27 (comment) . https://github.com/notifications/beacon/AKNhIOC_3BtR93rIHEnqsHes8tEvF2Ydks5oEWGjgaJpZM4EL4Fq.gif

from menus.

 avatar commented on June 14, 2024

I find It out.

Add this please to your doc.

$menu->add('Blog', 'blog');
$menu->blog->add('Blog 2', 'blog');

from menus.

kaidesu avatar kaidesu commented on June 14, 2024

Documentation on adding menu items can be found here now: https://github.com/caffeinated/menus/wiki/Basics-of-Menu-Items

from menus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.