This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/HttpKernel/Fragment/SsiFragmentRenderer.php

60 lines
1.3 KiB
PHP
Raw Normal View History

2014-03-23 00:04:57 +00:00
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Fragment;
use Symfony\Component\HttpKernel\Controller\ControllerReference;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\UriSigner;
/**
* Implements the ESI rendering strategy.
*
* @author Sebastian Krebs <krebs.seb@gmail.com>
*/
class SsiFragmentRenderer extends AbstractSurrogateFragmentRenderer
{
/** @var UriSigner */
private $signer;
/**
* Set uri signer
*
* @param UriSigner $signer
*/
public function setUriSigner(UriSigner $signer)
{
$this->signer = $signer;
}
/**
* {@inheritdoc}
*/
public function getName()
{
return 'ssi';
}
/**
* {@inheritdoc}
*/
protected function generateFragmentUri(ControllerReference $reference, Request $request, $absolute = false, $strict = true)
{
$uri = parent::generateFragmentUri($reference, $request, $absolute, $strict);
if ($this->signer) {
$uri = $this->signer->sign($uri);
}
return $uri;
}
}