Comments (8)
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.
And from an service provider? It's possible ?
from menus.
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.
Current value is "null". Within the Controller all okay.
from menus.
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.
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.
I find It out.
Add this please to your doc.
$menu->add('Blog', 'blog');
$menu->blog->add('Blog 2', 'blog');
from menus.
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)
- How to get Icons only HOT 2
- Laravel 5.6 HOT 1
- Call to undefined method asUl HOT 1
- Removing methods & breaking BC HOT 2
- Call to undefined method asUl
- PHP 7.4: Trying to access array offset on value of type null at caffeinated/menus/src/Menu.php:66 HOT 2
- Call to undefined method Caffeinated\Menus\Item::attributes() (0)
- ErrorException in Menu.php line 90: Trying to access array offset on value of type null
- Laravel 8 support
- Laravel 5.2 HOT 3
- ->attributes() is rendering double quotes HOT 1
- Menu Cache? HOT 1
- I use localization and need some help HOT 1
- Icon for children
- Module Menus? HOT 1
- Active Link Detection on SSL/HTTPS
- Children attributes HOT 1
- https url HOT 1
- Laravel 5.4 HOT 5
- Instalation laravel 5.5.3 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from menus.