Skip to content

Commit

Permalink
[FrameworkBundle] updated XML route description
Browse files Browse the repository at this point in the history
  • Loading branch information
jfsimon committed Oct 2, 2013
1 parent 04d767d commit 7b99ede
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
Expand Up @@ -128,9 +128,11 @@ private function getRouteDocument(Route $route, $name = null)
$routeXML->setAttribute('name', $name);
}

$routeXML->setAttribute('path', $route->getPath());
$routeXML->setAttribute('class', get_class($route));
$routeXML->setAttribute('path_regex', $route->compile()->getRegex());

$routeXML->appendChild($pathXML = $dom->createElement('path'));
$pathXML->setAttribute('regex', $route->compile()->getRegex());
$pathXML->appendChild(new \DOMText($route->getPath()));

if ('' !== $route->getHost()) {
$routeXML->appendChild($hostXML = $dom->createElement('host'));
Expand Down
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<route path="/hello/{name}" class="Symfony\Component\Routing\Route" path_regex="#^/hello(?:/(?P&lt;name&gt;[a-z]+))?$#s">
<route class="Symfony\Component\Routing\Route">
<path regex="#^/hello(?:/(?P&lt;name&gt;[a-z]+))?$#s">/hello/{name}</path>
<host regex="#^localhost$#s">localhost</host>
<scheme>http</scheme>
<scheme>https</scheme>
Expand Down
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<route path="/name/add" class="Symfony\Component\Routing\Route" path_regex="#^/name/add$#s">
<route class="Symfony\Component\Routing\Route">
<path regex="#^/name/add$#s">/name/add</path>
<host regex="#^localhost$#s">localhost</host>
<scheme>http</scheme>
<scheme>https</scheme>
Expand Down
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<routes>
<route name="route_1" path="/hello/{name}" class="Symfony\Component\Routing\Route" path_regex="#^/hello(?:/(?P&lt;name&gt;[a-z]+))?$#s">
<route name="route_1" class="Symfony\Component\Routing\Route">
<path regex="#^/hello(?:/(?P&lt;name&gt;[a-z]+))?$#s">/hello/{name}</path>
<host regex="#^localhost$#s">localhost</host>
<scheme>http</scheme>
<scheme>https</scheme>
Expand All @@ -18,7 +19,8 @@
<option key="opt2">val2</option>
</options>
</route>
<route name="route_2" path="/name/add" class="Symfony\Component\Routing\Route" path_regex="#^/name/add$#s">
<route name="route_2" class="Symfony\Component\Routing\Route">
<path regex="#^/name/add$#s">/name/add</path>
<host regex="#^localhost$#s">localhost</host>
<scheme>http</scheme>
<scheme>https</scheme>
Expand Down

0 comments on commit 7b99ede

Please sign in to comment.