-
Notifications
You must be signed in to change notification settings - Fork 114
Menus
Gravitano edited this page Jul 10, 2014
·
6 revisions
As explained on the Home page wiki, that for this package using the package menu pingpong/menus
. To find the manufacture and the addition of a menu, you can read the documentation of the package.
If you've read the documentation of pingpong/menus
, of course you find a part of taking the instance menu. To add additional menu, use that way.
In this package there are two instances the menu, which is admin-menu
and admin-menu-right
. The admin-menu
is a left menu and the admin-menu-right
is a right menu.
To add a menu follow the steps below:
- Create file named
menus.php
in your app directory. - Get instance of the specified menu and you can make additional menu.
// app/menus.php
# Left Menu
$leftMenu = Menu::instance('admin-menu');
// add a menu with url to a link
$leftMenu->url('admin/users', 'The Title');
// add a menu with url to a link
$leftMenu->route('your.route', 'The Title');
# Right Menu
$rightMenu = Menu::instance('admin-menu-right');
// add a menu with url to a link
$rightMenu->url('admin/users', 'The Title');
// add a menu with url to a link
$rightMenu->route('your.route', 'The Title');
// add dropdown
$rightMenu->dropdown('Pages', function ($sub)
{
$sub->route('admin.pages.index', 'All Pages');
$sub->route('admin.pages.create', 'Add New');
});
Please see the documentation of pingpong/menus for more information.