Created
April 11, 2014 15:05
-
-
Save silentworks/10476273 to your computer and use it in GitHub Desktop.
Get Slim protected routes out in a public function
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
<?php | |
namespace App\Vendor; | |
class Router extends \Slim\Router | |
{ | |
/** | |
* Get all the defined routes | |
* @return array | |
*/ | |
public function getRoutes() | |
{ | |
$routes = array(); | |
if (count($this->routes) > 0) { | |
/** @var \Slim\Route $route */ | |
foreach ($this->routes AS $route) { | |
$routes[] = $route; | |
} | |
} | |
return new \ArrayIterator($routes); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment