Download the PHP package delatbabel/nestedmenus without Composer

On this page you can find all versions of the php package delatbabel/nestedmenus. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package nestedmenus

nestedmenus

Database storage of nested menus, including rendering

Based On

Comes with

Installation

Add these lines to your composer.json file:

Once that is done, run the composer update command:

Alternatively just run this command:

Register Service Provider

After composer update completes, add this line to your config/app.php file in the 'providers' array:

Publish the Migrations

Publish the migrations

Run the migration

Ensure the categories types are set correctly in the seeder file. You can initialise this to whatever you like.

Run the Seeders

Run the seed (this will create the base menu structure as defined in the seeder)

You may prefer to build your own MenusTableSeeder class based on the code in MenusTableBaseSeeder to seed your own initial set of menus.

Usage

This class relies on the behind-the-scenes capabilities of Baum. For details on the use of that see the README on github or the Baum web site

Creating the Menu Structure

See the MenusTableBaseSeeder for an example of how to build the menu structure in the database. You can in fact just extend this seeder to create your own seeder, just overriding the function getNodes() to provide the menu structure to seed into the database.

Menu editors and the such like are still to be done.

The important parts of the database structure look like this when completed:

Note that at the moment the renderers available only support a 2 level menu structure. Level 0 is the heading. At level 1 are the various options, and at level 2 are the sub-options for each option.

See the Baum functions for more detail on creating and manipulating this structure.

Loading the Menu Structure

The menu structure can be loaded from the database using any normal Eloquent Model code, for example:

Note that you only need to load the top level of the menu in order to be able to render the entire menu.

Rendering the Menu Structure

See the ShowMenu class under src/Console/Commands for the details on how to do this. It's really simple:

Rendering to different menu structures requires different renderer classes. I will build more of these over time.

Placing the rendered menu on a view is as simple as this:

TODO

Integrate additional menu front end creators. There are a few out there. I have decided to allow for integration of both of these:

Lavary Menu

Completed a LavarySidebarRenderer class. I had to extend the Lavary menu classes in order to do this, so instead of their main repo use the VCS mentioned in the composer.json in this package. I have submitted a PR to the Lavary repo for this change. See PR #100.

Need to have separate renderer classes for the other menu types (header menus, pulldown menus, etc).

Vespakoen Menu

TBD

Architecture

Rationale

I want to be able to create AdminLTE based menus, which look like this:

I want to be able to create them dynamically rather than embed them in the view files.

I want to be able to store the menu structure in a database table so that it can be modified at run time or without having to change any code.

Imports

After using Baum successfully for my Nested Categories package, It seemed the obvious choice for heirarchical storage of the menu structure.

The only thing that remained is the creation of the views. I figured that there were a few options:

I found many packages on line to format the menu structure for display, but the two that I settled on were these:


All versions of nestedmenus with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
illuminate/contracts Version ^5.0
illuminate/support Version ^5.0
cviebrock/eloquent-sluggable Version ~3.0
baum/baum Version ~1.1
lavary/laravel-menu Version dev-master
vespakoen/menu Version 3.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package delatbabel/nestedmenus contains the following files

Loading the files please wait ....