Generates PHP code representing an array of defined routes together with the routes properties (e.g. requirements).
string PHP code
private function generateDeclaredRoutes() {
$routes = "array(\n";
foreach ($this
->getRoutes()
->all() as $name => $route) {
$compiledRoute = $route
->compile();
$properties = array();
$properties[] = $compiledRoute
->getVariables();
$properties[] = $route
->getDefaults();
$properties[] = $route
->getRequirements();
$properties[] = $compiledRoute
->getTokens();
$properties[] = $compiledRoute
->getHostTokens();
$routes .= sprintf(" '%s' => %s,\n", $name, str_replace("\n", '', var_export($properties, true)));
}
$routes .= ' )';
return $routes;
}