fixed CS
This commit is contained in:
parent
ee346bbc22
commit
aee033699b
@ -24,10 +24,10 @@ class TemplateController extends ContainerAware
|
|||||||
/**
|
/**
|
||||||
* Renders a template.
|
* Renders a template.
|
||||||
*
|
*
|
||||||
* @param string $template The template name
|
* @param string $template The template name
|
||||||
* @param int|null $maxAge Max age for client caching
|
* @param int|null $maxAge Max age for client caching
|
||||||
* @param int|null $sharedAge Max age for shared (proxy) caching
|
* @param int|null $sharedAge Max age for shared (proxy) caching
|
||||||
* @param Boolean|null $private Whether or not caching should apply for client caches only
|
* @param Boolean|null $private Whether or not caching should apply for client caches only
|
||||||
*
|
*
|
||||||
* @return Response A Response instance
|
* @return Response A Response instance
|
||||||
*/
|
*/
|
||||||
@ -35,18 +35,21 @@ class TemplateController extends ContainerAware
|
|||||||
{
|
{
|
||||||
/** @var $response \Symfony\Component\HttpFoundation\Response */
|
/** @var $response \Symfony\Component\HttpFoundation\Response */
|
||||||
$response = $this->container->get('templating')->renderResponse($template);
|
$response = $this->container->get('templating')->renderResponse($template);
|
||||||
|
|
||||||
if ($maxAge) {
|
if ($maxAge) {
|
||||||
$response->setMaxAge($maxAge);
|
$response->setMaxAge($maxAge);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($sharedAge) {
|
if ($sharedAge) {
|
||||||
$response->setSharedMaxAge($sharedAge);
|
$response->setSharedMaxAge($sharedAge);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($private) {
|
if ($private) {
|
||||||
$response->setPrivate();
|
$response->setPrivate();
|
||||||
} else if ($private === false || (is_null($private) && ($maxAge || $sharedAge))) {
|
} elseif ($private === false || (null === $private && ($maxAge || $sharedAge))) {
|
||||||
$response->setPublic($private);
|
$response->setPublic($private);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user