Created
May 23, 2014 13:52
-
-
Save Saeven/bb5a95c27afbc186cdb8 to your computer and use it in GitHub Desktop.
Possible to switch a route?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sem->attach('Zend\Mvc\Application', MvcEvent::EVENT_ROUTE, function( MvcEvent $ev) use($sm,$em) { | |
$rm = $ev->getRouteMatch()->getMatchedRouteName(); | |
if( getenv("environment") === "master" && $rm == 'zfcuser' ) | |
{ | |
$ev->setRouteMatch( /* switch the route out here */ ); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment