zendframework / zend-navigation

Navigation component from Zend Framework
BSD 3-Clause "New" or "Revised" License
20 stars 25 forks source link

Feature/compatible with mvc 3 #33

Closed RalfEggert closed 8 years ago

RalfEggert commented 8 years ago

Make Zend\Navigation compatible with Zend\Mvc and Zend\Router

froschdesign commented 8 years ago

@RalfEggert Don't forget the unit tests! (See Travis)

RalfEggert commented 8 years ago

Fixed the tests

froschdesign commented 8 years ago

@RalfEggert Some more:

vaclavvanik commented 8 years ago

@RalfEggert you can look at https://github.com/zendframework/zend-view/blob/master/src/Helper/Url.php

It consumes both Zend\Mvc\Router and Zend\Router.

froschdesign commented 8 years ago

@vaclavvanik Please move this problem to the Zend\View issue tracker. Thanks!

Btw. That's a good point!

vaclavvanik commented 8 years ago

@froschdesign I meant @RalfEggert can look at Zend\View\Helper\Url because this helper could be used with both Zend\Mvc 2.0 and 3.0. Ralfs changes are Mvc 3.0 imho.

froschdesign commented 8 years ago

@vaclavvanik You are right. I thought you mean the Zend\Navigation view helpers. :grin:

It consumes both Zend\Mvc\Router and Zend\Router.

This is an option for a next minor release in version 2 of Zend\Navigation. For version 3 with can remove Zend\Mvc – after a deeper look into the code base.

RalfEggert commented 8 years ago

The only dependency to Zend\Mvc left is in https://github.com/zendframework/zend-navigation/blob/develop/src/Page/Mvc.php It uses the two constants ModuleRouteListener::ORIGINAL_CONTROLLER and ModuleRouteListener::MODULE_NAMESPACE.

Not sure about the Zend\Permissions. It is used in https://github.com/zendframework/zend-navigation/blob/develop/src/Page/AbstractPage.php and already added to the require-dev section in composer.json.

weierophinney commented 8 years ago

@RalfEggert I noticed that Travis was reporting test failures for zend-mvc v2 (and servicemanager, etc.). I took the liberty of pulling locally and figuring out how to get things running. This included:

I've tested locally with both an updated composer.lock, as well as running --prefer-lowest, and it appears to work well! I'm opening a competing PR that incorporates your work just to ensure that tests pass against travis; if they do, I'll issue a 2.8.0 release.

Thanks for doing the heavy-lifting, @RalfEggert !

RalfEggert commented 8 years ago

:+1: