ppiixx/cake-menu

This package is abandoned and no longer maintained. No replacement package was suggested.

An nice menu component for CakePHP v3.0

Installs: 118

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Open Issues: 0

Type:cakephp-plugin

1.0.0 2015-07-21 16:52 UTC

This package is not auto-updated.

Last update: 2015-11-29 05:38:26 UTC


README

Introduction

Our first plugin developed to assist in the creation of menus, using our other plugin

Installation

First follow the installation: Install

Require the package:

composer require ppiixx/menu

Run the following commands:

bin/cake plugin load -r menu
bin/cake migrations migrate -p menu
bin/cake seed_cake_menu

And place in your AppController.php

// AppController.php
$this->loadComponent('menu.Menu');

// Sample of use
$this->set('menu', $this->Menu->userMenu($this->Auth->user('id')));

Adding other plugins controllers

// AppController.php

public function initialize()
{
    parent::initialize();

    $this->loadComponent('Flash');
    $this->loadComponent('.Authorizer');
    $this->loadComponent('menu.Menu');
    $this->loadComponent('Auth', [
            'authorize'   => ['.Cake'],
            'loginAction' => [
            'controller' => 'Users',
            'action'     => 'login',
            'plugin'     => ''
        ],
            'loginRedirect' => [
            'controller'    => 'Users',
            'action'    => 'index',
            'plugin'     => ''
        ]   
    ]);

    // SAMPLE!!!!
    $this->Menu->addControllersFolder('menu\\Controller\\', 'vendor/ppiixx/menu/src/Controller/');
    $this->Menu->addControllersFolder('\\Controller\\', 'vendor/ppiixx/authorizer/src/Controller/');
}

Modules

You can access the modules panel at:

http://you-domain.dev/cake_menu/modules