bug #9197 [FrameworkBundle] updated XML route description (jfsimon)
This PR was merged into the master branch.
Discussion
----------
[FrameworkBundle] updated XML route description
This PR turns
```xml
<route name="route_1" path="/hello/{name}" class="Symfony\Component\Routing\Route" path_regex="#^/hello(?:/(?P<name>[a-z]+))?$#s">
```
into
```xml
<route name="route_1" class="Symfony\Component\Routing\Route">
<path regex="#^/hello(?:/(?P<name>[a-z]+))?$#s">/hello/{name}</path>
```
in XML routing description.
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | yes
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #7887
| License | MIT
| Doc PR | n/a
Commits
-------
7b99ede
[FrameworkBundle] updated XML route description
This commit is contained in:
commit
96fb922e67
@ -128,9 +128,11 @@ class XmlDescriptor extends Descriptor
|
|||||||
$routeXML->setAttribute('name', $name);
|
$routeXML->setAttribute('name', $name);
|
||||||
}
|
}
|
||||||
|
|
||||||
$routeXML->setAttribute('path', $route->getPath());
|
|
||||||
$routeXML->setAttribute('class', get_class($route));
|
$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()) {
|
if ('' !== $route->getHost()) {
|
||||||
$routeXML->appendChild($hostXML = $dom->createElement('host'));
|
$routeXML->appendChild($hostXML = $dom->createElement('host'));
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<route path="/hello/{name}" class="Symfony\Component\Routing\Route" path_regex="#^/hello(?:/(?P<name>[a-z]+))?$#s">
|
<route class="Symfony\Component\Routing\Route">
|
||||||
|
<path regex="#^/hello(?:/(?P<name>[a-z]+))?$#s">/hello/{name}</path>
|
||||||
<host regex="#^localhost$#s">localhost</host>
|
<host regex="#^localhost$#s">localhost</host>
|
||||||
<scheme>http</scheme>
|
<scheme>http</scheme>
|
||||||
<scheme>https</scheme>
|
<scheme>https</scheme>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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>
|
<host regex="#^localhost$#s">localhost</host>
|
||||||
<scheme>http</scheme>
|
<scheme>http</scheme>
|
||||||
<scheme>https</scheme>
|
<scheme>https</scheme>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<routes>
|
<routes>
|
||||||
<route name="route_1" path="/hello/{name}" class="Symfony\Component\Routing\Route" path_regex="#^/hello(?:/(?P<name>[a-z]+))?$#s">
|
<route name="route_1" class="Symfony\Component\Routing\Route">
|
||||||
|
<path regex="#^/hello(?:/(?P<name>[a-z]+))?$#s">/hello/{name}</path>
|
||||||
<host regex="#^localhost$#s">localhost</host>
|
<host regex="#^localhost$#s">localhost</host>
|
||||||
<scheme>http</scheme>
|
<scheme>http</scheme>
|
||||||
<scheme>https</scheme>
|
<scheme>https</scheme>
|
||||||
@ -18,7 +19,8 @@
|
|||||||
<option key="opt2">val2</option>
|
<option key="opt2">val2</option>
|
||||||
</options>
|
</options>
|
||||||
</route>
|
</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>
|
<host regex="#^localhost$#s">localhost</host>
|
||||||
<scheme>http</scheme>
|
<scheme>http</scheme>
|
||||||
<scheme>https</scheme>
|
<scheme>https</scheme>
|
||||||
|
Reference in New Issue
Block a user