<commit_before>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. 2. Configure referenced modules ([CsnUser](https://github.com/coolcsn/CsnUser) and [CsnAuthorization](https://github.com/coolcsn/CsnAuthorization)) following their instructions.

Go to your application configuration in ```./config/application.config.php```and 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 sing *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:

 - [CsnUser](https://github.com/coolcsn/CsnUser)
 - [CsnAuthorization](https://github.com/coolcsn/CsnAuthorization)
Recommends
==========

- [coolcsn/CsnCms](https://github.com/coolcsn/CsnCms) - Content management system;<commit_msg>Edit readme<commit_after>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](https://github.com/coolcsn/CsnUser) and [CsnAuthorization](https://github.com/coolcsn/CsnAuthorization)) following their instructions.

Go to your application configuration in ```./config/application.config.php```and 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 sing *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:

 - [CsnUser](https://github.com/coolcsn/CsnUser)
 - [CsnAuthorization](https://github.com/coolcsn/CsnAuthorization)
 
Recommends
==========

- [coolcsn/CsnCms](https://github.com/coolcsn/CsnCms) - Content management system;
{'fraction_non_alphanumeric': 0.15262187971184454, 'fraction_numerical': 0.002512983749371754, 'mean_word_length': 3.4954819277108435, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 45, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3642892', 'n_tokens_mistral': 1796, 'n_tokens_neox': 1638, 'n_words': 523}