File tree Expand file tree Collapse file tree 2 files changed +19
-5
lines changed
Filter options
src/Symfony/Bundle/FrameworkBundle Expand file tree Collapse file tree 2 files changed +19
-5
lines changed
Original file line number Diff line number Diff line change 29
29
</xsd : choice >
30
30
</xsd : group >
31
31
32
- <xsd : complexType name =" base-route" >
32
+ <xsd : complexType name =" base-route" abstract = " true " >
33
33
<xsd : attribute name =" id" type =" xsd:string" use =" required" />
34
34
<xsd : attribute name =" path" type =" xsd:string" />
35
35
<xsd : attribute name =" host" type =" xsd:string" />
46
46
<xsd : element name =" context" type =" map" minOccurs =" 0" maxOccurs =" 1" />
47
47
<xsd : group ref =" base-configs" minOccurs =" 0" maxOccurs =" unbounded" />
48
48
</xsd : sequence >
49
- <xsd : attribute name =" template" type =" xsd:string" />
49
+ <xsd : attribute name =" template" type =" xsd:string" use = " required " />
50
50
<xsd : attribute name =" max-age" type =" xsd:int" />
51
51
<xsd : attribute name =" shared-max-age" type =" xsd:int" />
52
52
<xsd : attribute name =" private" type =" xsd:boolean" />
61
61
<xsd : sequence >
62
62
<xsd : group ref =" base-configs" minOccurs =" 0" maxOccurs =" unbounded" />
63
63
</xsd : sequence >
64
- <xsd : attribute name =" redirect-to-route" type =" xsd:string" />
64
+ <xsd : attribute name =" redirect-to-route" type =" xsd:string" use = " required " />
65
65
<xsd : attribute name =" permanent" type =" xsd:boolean" />
66
66
<xsd : attribute name =" ignore-attributes" type =" xsd:string" />
67
67
<xsd : attribute name =" keep-request-method" type =" xsd:boolean" />
77
77
<xsd : sequence >
78
78
<xsd : group ref =" base-configs" minOccurs =" 0" maxOccurs =" unbounded" />
79
79
</xsd : sequence >
80
- <xsd : attribute name =" redirect-to-url" type =" xsd:string" />
80
+ <xsd : attribute name =" redirect-to-url" type =" xsd:string" use = " required " />
81
81
<xsd : attribute name =" permanent" type =" xsd:boolean" />
82
82
<xsd : attribute name =" scheme" type =" xsd:string" />
83
83
<xsd : attribute name =" http-port" type =" xsd:int" />
Original file line number Diff line number Diff line change 17
17
use Symfony \Component \Config \Util \Exception \XmlParsingException ;
18
18
use Symfony \Component \Config \Util \XmlUtils ;
19
19
use Symfony \Component \Routing \Loader \XmlFileLoader as BaseXmlFileLoader ;
20
+ use Symfony \Component \Routing \Route ;
20
21
use Symfony \Component \Routing \RouteCollection ;
21
22
22
23
/**
@@ -118,8 +119,21 @@ protected function parseRoute(RouteCollection $collection, \DOMElement $node, $p
118
119
119
120
parent ::parseRoute ($ collection , $ node , $ path );
120
121
121
- $ route = $ collection ->get ($ node ->getAttribute (('id ' )));
122
+ if ($ route = $ collection ->get ($ id = $ node ->getAttribute (('id ' )))) {
123
+ $ this ->parseConfig ($ node , $ route , $ templateContext );
122
124
125
+ return ;
126
+ }
127
+
128
+ foreach ($ node ->getElementsByTagNameNS (self ::NAMESPACE_URI , 'path ' ) as $ n ) {
129
+ $ route = $ collection ->get ($ id .'. ' .$ n ->getAttribute ('locale ' ));
130
+
131
+ $ this ->parseConfig ($ node , $ route , $ templateContext );
132
+ }
133
+ }
134
+
135
+ private function parseConfig (\DOMElement $ node , Route $ route , array $ templateContext ): void
136
+ {
123
137
switch ($ node ->localName ) {
124
138
case 'template-route ' :
125
139
$ route
You can’t perform that action at this time.
0 commit comments