Giter Site home page Giter Site logo

csnaclnavigation's Introduction

CsnAclNavigation

What is CsnAclNavigation?

CsnAclNavigation is a Module for Navigation using Access Control List based on Zend Framework 2

What exactly does CsnAclNavigation?

CsnAclNavigation has been created with educational purposes to demonstrate how Navigation can be done. It is fully functional.

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

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

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

'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.

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.

For example:

	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 :

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

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

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

Dependencies

This Module depends on the following Modules:

Recommends

csnaclnavigation's People

Contributors

atonevbg avatar revov avatar wingman007 avatar coolcsn avatar

Watchers

James Cloos avatar Jahidur Rahman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.