2017 © Pedro Peláez
 

library csn-acl-navigation

Zend Framework 2 Module for Navigation using Acl

image

coolcsn/csn-acl-navigation

Zend Framework 2 Module for Navigation using Acl

  • Tuesday, May 6, 2014
  • by wingman
  • Repository
  • 2 Watchers
  • 6 Stars
  • 1,538 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 12 Forks
  • 1 Open issues
  • 2 Versions
  • 1 % Grown

The README.md

CsnAclNavigation

What is CsnAclNavigation?, (*1)

CsnAclNavigation is a Module for Navigation using Access Control List based on Zend Framework 2, (*2)

What exactly does CsnAclNavigation?, (*3)

CsnAclNavigation has been created with educational purposes to demonstrate how Navigation can be done. It is fully functional., (*4)

Installation

  1. Installation via composer is supported, simply run (make sure you've set "minimum-stability": "dev" in your composer.json file): php composer.phar require coolcsn/csn-acl-navigation:dev-master, (*5)

  2. Configure referenced modules (CsnUser and CsnAuthorization) following their instructions., (*6)

Go to your application configuration in ./config/application.config.phpand add 'CsnAclNavigation'. An example application configuration could look like the following:, (*7)

'modules' => array(
    'Application',
    'DoctrineModule',
    'DoctrineORMModule',
    'CsnUser',
    'CsnAuthorization',
    'CsnAclNavigation'
)

Configuration

  1. Copy the sample Navigation configuration from ./vendor/coolcsn/csn-acl-navigation/config/navigation.global.php.dist. to ./config/autoload renaming it to navigation.global.php and edit.

We recommend using the same names for the resources and privileges of the pages as for the controllers and actions. This is done to keep the Navigation and Authorization in sync., (*8)

If we have a link in our navigation to resource named "Album\Controller\Album" and privilege "index", please use the same resource and privilege name to configure your MVC page in the navigation., (*9)

For example:, (*10)

    array(
                 'label' => 'Album', // 'Page #1',
                 'route' => 'album', // 'page-1',
                 'action'     => 'index',
                 'controller' => 'index',
                 'resource' => 'Album\Controller\Album',
                 'privilege'    => 'index',
                 'pages' => array(
                     array(
                         'label' => 'Add', // 'Child #1',
                         'route' => 'album',
                         'params' => array('action' => 'add'),
                         'resource' => 'Album\Controller\Album',
                         'privilege'    => 'add',
                     ),
                 ),
             ),

Show navigation

Add this somewhere in your layout ./module/Application/view/layout/layout.phtml :, (*11)

<?php echo $this->navigation('navigation')->menu(); ?>

If you are you using Bootstrap (as the default skeleton application does), you may as well use:, (*12)

<?php echo $this->navigation('navigation')->menu()->setUlClass('nav navbar-nav'); ?>

Dependencies

This Module depends on the following Modules:, (*13)

Recommends

The Versions

06/05 2014

dev-master

9999999-dev https://github.com/coolcsn/CsnAclNavigation

Zend Framework 2 Module for Navigation using Acl

  Sources   Download

BSD-3-Clause

The Requires

 

by Anton Tonev

zf2 csn-acl-navigation

10/10 2013

0.1.0

0.1.0.0 https://github.com/coolcsn/CsnAclNavigation

Zend Framework 2 Module for Navigation using Acl

  Sources   Download

BSD-3-Clause

The Requires

 

by Anton Tonev

zf2 csn-acl-navigation