E5FE fixed a circular reference (closes #6730) by fabpot · Pull Request #6850 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?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\Bundle\FrameworkBundle\RenderingStrategy;

use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\UriSigner;
use Symfony\Component\HttpKernel\RenderingStrategy\HIncludeRenderingStrategy;

/**
* Implements the Hinclude rendering strategy.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class ContainerAwareHIncludeRenderingStrategy extends HIncludeRenderingStrategy
{
private $container;

/**
* {@inheritdoc}
*/
public function __construct(ContainerInterface $container, UriSigner $signer = null, $globalDefaultTemplate = null)
{
$this->container = $container;

parent::__construct(null, $signer, $globalDefaultTemplate);
}

/**
* {@inheritdoc}
*/
public function render($uri, Request $request, array $options = array())
{
if (!$this->templating) {
$this->templating = $this->container->get('templating');
}

return parent::render($uri, $request, $options);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parameters>
<parameter key="http_content_renderer.class">Symfony\Component\HttpKernel\HttpContentRenderer</parameter>
<parameter key="http_content_renderer.strategy.default.class">Symfony\Component\HttpKernel\RenderingStrategy\DefaultRenderingStrategy</parameter>
<parameter key="http_content_renderer.strategy.hinclude.class">Symfony\Component\HttpKernel\RenderingStrategy\HIncludeRenderingStrategy</parameter>
<parameter key="http_content_renderer.strategy.hinclude.class">Symfony\Bundle\FrameworkBundle\RenderingStrategy\ContainerAwareHIncludeRenderingStrategy</parameter>
<parameter key="http_content_renderer.strategy.hinclude.global_template"></parameter>
<parameter key="http_content_renderer.proxy_path">/_proxy</parameter>
</parameters>
Expand All @@ -27,7 +27,7 @@

<service id="http_content_renderer.strategy.hinclude" class="%http_content_renderer.strategy.hinclude.class%">
<tag name="kernel.content_renderer_strategy" />
<argument type="service" id="templating" on-invalid="null" />
<argument type="service" id="service_container" />
<argument type="service" id="uri_signer" />
<argument>%http_content_renderer.strategy.hinclude.global_template%</argument>
<call method="setProxyPath"><argument>%http_content_renderer.proxy_path%</argument></call>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
*/
class HIncludeRenderingStrategy extends ProxyAwareRenderingStrategy
{
private $templating;
protected $templating;

private $globalDefaultTemplate;
private $signer;

Expand Down
0