2017 © Pedro Peláez
 

cakephp-plugin cakephp3-easy-menus

An easy to use table based menu plugin for CakePHP3

image

markhatchell/cakephp3-easy-menus

An easy to use table based menu plugin for CakePHP3

  • Friday, June 12, 2015
  • by markhatchell
  • Repository
  • 2 Watchers
  • 1 Stars
  • 70 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 3 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

EasyMenus plugin for CakePHP3

Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

Notice

This plugin is still in a development phase., (*2)

If you wish to contribute please let me know., (*3)

The plugin should now work pretty well., (*4)

The requirements are not included in composer as you should include them directly with composer or a CDN., (*5)

Features

  • Store your menu in a database table so that your load-balanced servers can all access and display the same menu without having to update the source.
  • Nested menu structure.
  • Based on Bootstrap nav.
  • Manual or Route based link types.
  • Collects all the routes and offers them for you to use them as a menu item.
  • Class parameters for the menu to aid with styling.
  • Configurable menu display options.

Upcoming Features

  • √ Class parameters for the menu to aid with styling.
  • Showing and hiding menu items based on if the user is authenticated.
  • Regeneration of static link field in the db based on the route info stored in the params field.
  • Role based access, this will require the users of this plugin to have a role field on their user entities.
  • Caching for the menus.

Requirements

  • bootstrap - used for form layout and menu display.
  • jQuery - used for form layout and menu display.

With composer:

composer require elboletaire/twbs-cake-plugin:~3.0
composer require twbs/bootstrap:~3.0

composer require components/jquery:1.*
#[OR]
composer require components/jquery:2.* #jQuery 2.x (IE <9 not supported)

With CDN:

$this->Html->css('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css');
$this->Html->css('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css');
$this->Html->script('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js');

$this->Html->script('http://code.jquery.com/jquery-1.11.3.min.js');
//[OR]
$this->Html->script('http://code.jquery.com/jquery-2.1.4.min.js'); //jQuery 2.x (IE <9 not supported)

Installation

You can install this plugin into your CakePHP application using composer., (*6)

The recommended way to install composer packages is:, (*7)

composer require 'markhatchell/cakephp3-easy-menus:dev-master'

Usage

Add this to config/bootstrap.php to activate the plugin:, (*8)

Plugin::load('EasyMenus', ['bootstrap' => false, 'routes' => true]);

Install the table for EasyMenus:, (*9)

bin/cake migrations migrate --plugin EasyMenus

To display the menu: Add this to /src/Controller/AppController.php, (*10)

use EasyMenus\Controller\Component\EasyMenusComComponent;
...
    public function initialize()
    {
        parent::initialize();
        ...
        $this->loadComponent('EasyMenus.EasyMenusCom');
    }

Add this to src/template/layout/default.ctp:, (*11)

<?=$this->Element('EasyMenus.easymenu')?>

To access the menu admin UI navigate to:, (*12)

/admin/EasyMenus

The Versions

12/06 2015

dev-master

9999999-dev

An easy to use table based menu plugin for CakePHP3

  Sources   Download

MIT

The Requires

 

The Development Requires