Skip to content
This repository has been archived by the owner on Feb 21, 2019. It is now read-only.

Added new feature: Zend\Navigation #4

Closed
wants to merge 1 commit into from

Conversation

jlratwil
Copy link
Contributor

So far the basic dropdown menu of Twitter Bootstrap is created. Other features to be followed: Tabs, Pills, Stacked Tabs, Stacked Pills, and Nav List. Feel free to make changes to suit your needs.

Usage:

echo $this->ztbNavigation('zendnavigation')->nav();

For quick and dirty guide on Zend\Navigation see this article: http://adam.lundrigan.ca/2012/07/quick-and-dirty-zf2-zend-navigation/

So far the basic dropdown menu of Twitter Bootstrap is created. Other
features to be followed: Tabs, Pills, Stacked Tabs, Stacked Pills, and
Nav List. Feel free to make changes to suit your needs.
*
* @var string
*/
const NS = 'ZfcTwitterBootstrap\View\Helper\Navigation';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't look like this is used anywhere... is there a purpose to this constant?

@mwillbanks
Copy link
Owner

Really love the feature man! See if you can sync this with ZF master and I can merge this in! If you have anytime it would be great if you could add this to the readme as well. Otherwise if not I can certainly update that. Excellent work!

@jlratwil
Copy link
Contributor Author

Thanks! Will do my best to sync with ZF master since I tested this on ZF2 RC 4. The code might change because I wanted to try another approach to achieve the code like below.

echo $this->navigation('zendnavigation')->nav();

Basically, I am trying to avoid reinventing the wheel.

@RalfEggert
Copy link

Any news on this?

@mwillbanks
Copy link
Owner

Nothing yet; just waiting on some updates. Otherwise I am going to attempt to get to this at some point here in the near future.

@japaveh
Copy link

japaveh commented Jan 17, 2013

Is there any update on this issue?

@mwillbanks
Copy link
Owner

I am actually working on navigation component related items this week; also please see a discussion that is going on on zf-contributors: http://zend-framework-community.634137.n4.nabble.com/Zend-View-Helper-Navigation-Issues-Proposed-Changes-td4658767.html

@mwillbanks
Copy link
Owner

Closing this since feedback has not been produced.

@mwillbanks mwillbanks closed this Feb 21, 2013
@dperjar
Copy link

dperjar commented Apr 11, 2013

So the trail kind of goes cold here, just wondering if there are any updates?

I've tried using the code in this PR and it produces a SM error: Fatal error: Uncaught exception 'Zend\ServiceManager\Exception\ServiceNotFoundException' with message 'Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for ztbNavigation'

UPDATE:
For those interested in using this: in addition to copying over the files present in this pull request the following must be done:

  1. Add the following to ZfcTwitterBootstrap's module.config.php file:
<?php
return array(
    'view_helpers' => array(
        'invokables' => array(
            ...,
            ...,
            'ztbNavigation'      => 'ZfcTwitterBootstrap\View\Helper\Navigation', //Add this line
        ),
    ),
);
  1. When calling ztbNavigation substitue the name of your navigation instead of 'zendnavigation'. Mine was 'Navigation' (I believe this is what it's called in the ZF2 Skeleton Application), so my call looked like:
echo $this->ztbNavigation('Navigation')->nav();

@mwillbanks
Copy link
Owner

There is a cleaner approach to doing this than the PR had originally done. I have simply not had the time to focus on implementing it at this point but navigation component has a lot of use cases that we need to solve.

@dperjar
Copy link

dperjar commented Apr 25, 2013

Agreed. I'm not sure I'm well versed enough yet to identify all of the issues and submit a PR, but it may be worth outlining some of those in case someone is itching to get started. I'm sure a lot of people would be interested in the feature.

@dperjar
Copy link

dperjar commented Jun 1, 2013

Just for the record, this code no longer works. Looks like updates to ZF2 Navigation make it incompatible.

@japaveh
Copy link

japaveh commented Jun 1, 2013

It is pretty easy to change the code such that it matches the extended class in ZF2.2
I've done it here https://github.com/JapavehWebdesign/ZfcTwitterBootstrap

@dperjar
Copy link

dperjar commented Jun 1, 2013

Thanks Johan! I also realized I never noted in my first post the things that needed to be added to the module's autoload_classmap.php. You can see them in Johan's commit: https://github.com/JapavehWebdesign/ZfcTwitterBootstrap/commit/59df8c628b2d9fb70d681762537456cce77a87b1

     'ZfcTwitterBootstrap\View\Helper\Navigation'               => __DIR__ . '/src/ZfcTwitterBootstrap/View/Helper/Navigation.php',
     'ZfcTwitterBootstrap\View\Helper\Navigation\Nav'           => __DIR__ . '/src/ZfcTwitterBootstrap/View/Helper/Navigation/Nav.php',
     'ZfcTwitterBootstrap\View\Helper\Navigation\PluginManager' => __DIR__ . '/src/ZfcTwitterBootstrap/View/Helper/Navigation/PluginManager.php',

mwillbanks pushed a commit that referenced this pull request Jun 4, 2013
* Added basic navigation menu support based off of the PR from @jlratwil
* Added basic navigation breadcrumb support
@mwillbanks
Copy link
Owner

Alright folks; sorry for the long delay but I have added this in with some slight changes as well as breadcrumb support.

@dperjar
Copy link

dperjar commented Jun 4, 2013

Much appreciated, Mike.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants