ppiixx / cake-menu
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
Requires
- php: >=5.4.16
- cakephp/cakephp: ~3.0
- ppiixx/cake-authorizer: dev-master
Requires (Dev)
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: