PHPackages                             spiffy/spiffy-navigation - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. spiffy/spiffy-navigation

AbandonedLibrary[Utility &amp; Helpers](/categories/utility)

spiffy/spiffy-navigation
========================

Zend Framework 2 Module that aims to replace Zend\\Navigation

1.0.4(12y ago)2378.8k17[4 PRs](https://github.com/spiffyjr/spiffy-navigation/pulls)2PHPPHP &gt;=5.3.3

Since Jan 31Pushed 10y ago5 watchersCompare

[ Source](https://github.com/spiffyjr/spiffy-navigation)[ Packagist](https://packagist.org/packages/spiffy/spiffy-navigation)[ Docs](http://www.github.com/spiffyjr/spiffy-navigation/)[ RSS](/packages/spiffy-spiffy-navigation/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (15)Versions (11)Used By (2)

SpiffyNavigation Module for Zend Framework 2
============================================

[](#spiffynavigation-module-for-zend-framework-2)

SpiffyNavigation is a navigation module for ZF2 intended to be a replacement for Zend\\Navigation when ZF3 is able to break BC.

Project Status
--------------

[](#project-status)

[![Master Branch Build Status](https://camo.githubusercontent.com/6ada6614ad5c0e1198696ccd813cd8213bda4fc820ba458b69b06bb91884e315/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f7370696666796a722f7370696666792d6e617669676174696f6e2e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/spiffyjr/spiffy-navigation)[![Coverage Status](https://camo.githubusercontent.com/22af4f1e9b22b1d36f8978245f1471d40ab33d2393077433e792ce022c3acb2a/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f7370696666796a722f7370696666792d6e617669676174696f6e2f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/spiffyjr/spiffy-navigation?branch=master)

Requirements
------------

[](#requirements)

- PHP 5.3 or higher
- [Zend Framework 2](http://www.github.com/zendframework/zf2)

Installation
------------

[](#installation)

Installation of SpiffyNavigation uses composer. For composer documentation, please refer to [getcomposer.org](http://getcomposer.org/).

### Installation steps

[](#installation-steps)

1. `cd my/project/directory`
2. create a `composer.json` file with following contents:

    ```
    {
        "require": {
            "spiffy/spiffy-navigation": "dev-master"
        }
    }
    ```
3. install composer via `curl -s http://getcomposer.org/installer | php` (on windows, download  and execute it with PHP)
4. run `php composer.phar install`
5. open `my/project/directory/configs/application.config.php` and add the following key to your `modules`:

    ```
    'SpiffyNavigation',
    ```

Providers
---------

[](#providers)

[Providers](https://github.com/spiffyjr/spiffy-navigation/tree/feature/providers/src/SpiffyNavigation/Provider) let you create your navigation containers from various sources. The following providers are included out of the box:

- [array](https://github.com/spiffyjr/spiffy-navigation/blob/feature/providers/src/SpiffyNavigation/Provider/ArrayProvider.php): builds a container from an array.
- [config](https://github.com/spiffyjr/spiffy-navigation/blob/feature/providers/src/SpiffyNavigation/Provider/ConfigProvider.php): builds a container from a file using Zend\\Config.
- [json](https://github.com/spiffyjr/spiffy-navigation/blob/feature/providers/src/SpiffyNavigation/Provider/JsonProvider.php): builds a container from a json string.

Creating containers
-------------------

[](#creating-containers)

Creating navigation containers is done via the module configuration using the `spiffy_navigation` key. The containers array can take two types of values: a string and an array. If you pass a string the container will be created from a provider matching the name if it exists, pulled from the service manager or instantiated directly. If you pass an array the container is built using the ContainerFactory::create() method.

```
