Last active
December 20, 2015 11:49
-
-
Save DASPRiD/6126256 to your computer and use it in GitHub Desktop.
Prepending a route programatically.
This file contains hidden or 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
<?php | |
$statusRoute = $routeStack->getRoute('status'); | |
$versionRoute = new Segment('/v:version'); | |
$chainRoute = new Chain(array($versionRoute, $statusRoute), $routeStack->getRoutePluginManager(), null); | |
$routeStack->removeRoute('status'); // Not really required, as addRoute() will override this anyway… just for completeness. | |
$routeStack->addRoute('status', $chainRoute); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment