|
@@ -136,7 +136,7 @@ class Engine extends BaseEngine
|
|
return $parameters;
|
|
return $parameters;
|
|
}
|
|
}
|
|
|
|
|
|
- // Bundle:controller:action(:renderer)
|
|
|
|
|
|
+ // Bundle:controller:action(.format)(:renderer)
|
|
public function splitTemplateName($name, array $defaults = array())
|
|
public function splitTemplateName($name, array $defaults = array())
|
|
{
|
|
{
|
|
$parts = explode(':', $name, 4);
|
|
$parts = explode(':', $name, 4);
|
|
@@ -157,13 +157,18 @@ class Engine extends BaseEngine
|
|
)
|
|
)
|
|
);
|
|
);
|
|
|
|
|
|
- if (isset($parts[3]) && $parts[3]) {
|
|
|
|
- $options['renderer'] = $parts[3];
|
|
|
|
|
|
+ if (false !== $pos = strpos($parts[2], '.')) {
|
|
|
|
+ $options['format'] = substr($parts[2], $pos);
|
|
|
|
+ $parts[2] = substr($parts[2], 0, $pos);
|
|
|
|
+ } else {
|
|
|
|
+ $format = $this->container->getRequestService()->getRequestFormat();
|
|
|
|
+ if (null !== $format && 'html' !== $format) {
|
|
|
|
+ $options['format'] = '.'.$format;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
- $format = $this->container->getRequestService()->getRequestFormat();
|
|
|
|
- if (null !== $format && 'html' !== $format) {
|
|
|
|
- $options['format'] = '.'.$format;
|
|
|
|
|
|
+ if (isset($parts[3]) && $parts[3]) {
|
|
|
|
+ $options['renderer'] = $parts[3];
|
|
}
|
|
}
|
|
|
|
|
|
return array($parts[2], $options);
|
|
return array($parts[2], $options);
|