@@ -136,7 +136,7 @@ protected function escapeParameters(array $parameters)
136
136
return $ parameters ;
137
137
}
138
138
139
- // Bundle:controller:action(:renderer)
139
+ // Bundle:controller:action(.format)( :renderer)
140
140
public function splitTemplateName ($ name , array $ defaults = array ())
141
141
{
142
142
$ parts = explode (': ' , $ name , 4 );
@@ -157,13 +157,18 @@ public function splitTemplateName($name, array $defaults = array())
157
157
)
158
158
);
159
159
160
- if (isset ($ parts [3 ]) && $ parts [3 ]) {
161
- $ options ['renderer ' ] = $ parts [3 ];
160
+ if (false !== $ pos = strpos ($ parts [2 ], '. ' )) {
161
+ $ options ['format ' ] = substr ($ parts [2 ], $ pos );
162
+ $ parts [2 ] = substr ($ parts [2 ], 0 , $ pos );
163
+ } else {
164
+ $ format = $ this ->container ->getRequestService ()->getRequestFormat ();
165
+ if (null !== $ format && 'html ' !== $ format ) {
166
+ $ options ['format ' ] = '. ' .$ format ;
167
+ }
162
168
}
163
169
164
- $ format = $ this ->container ->getRequestService ()->getRequestFormat ();
165
- if (null !== $ format && 'html ' !== $ format ) {
166
- $ options ['format ' ] = '. ' .$ format ;
170
+ if (isset ($ parts [3 ]) && $ parts [3 ]) {
171
+ $ options ['renderer ' ] = $ parts [3 ];
167
172
}
168
173
169
174
return array ($ parts [2 ], $ options );
0 commit comments