Skip to content

Commit

Permalink
[FoundationBundle] removed the request.base_path parameter (the DIC c…
Browse files Browse the repository at this point in the history
…an now be immutable)
  • Loading branch information
fabpot committed Jun 27, 2010
1 parent d8efe7e commit 95769bc
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 3 deletions.
37 changes: 37 additions & 0 deletions src/Symfony/Framework/FoundationBundle/Helper/AssetsHelper.php
@@ -0,0 +1,37 @@
<?php

namespace Symfony\Framework\FoundationBundle\Helper;

use Symfony\Components\HttpKernel\Request;
use Symfony\Components\Templating\Helper\AssetsHelper as BaseAssetsHelper;

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

/**
* AssetsHelper is the base class for all helper classes that manages assets.
*
* @package Symfony
* @subpackage Framework_FoundationBundle
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
*/
class AssetsHelper extends BaseAssetsHelper
{
/**
* Constructor.
*
* @param Symfony\Components\HttpKernel\Request $request A Request instance
* @param string|array $baseURLs The domain URL or an array of domain URLs
* @param string $version The version
*/
public function __construct(Request $request, $baseURLs = array(), $version = null)
{
parent::__construct($request->getBasePath(), $baseURLs, $version);
}
}
Expand Up @@ -61,7 +61,6 @@ public function resolve(Event $event)
'host' => $request->getHost(),
'is_secure' => $request->isSecure(),
));
$this->container->setParameter('request.base_path', $request->getBasePath());
}

if ($request->path->has('_controller')) {
Expand Down
Expand Up @@ -12,7 +12,7 @@
<parameter key="templating.helper.javascripts.class">Symfony\Components\Templating\Helper\JavascriptsHelper</parameter>
<parameter key="templating.helper.stylesheets.class">Symfony\Components\Templating\Helper\StylesheetsHelper</parameter>
<parameter key="templating.helper.slots.class">Symfony\Components\Templating\Helper\SlotsHelper</parameter>
<parameter key="templating.helper.assets.class">Symfony\Components\Templating\Helper\AssetsHelper</parameter>
<parameter key="templating.helper.assets.class">Symfony\Framework\FoundationBundle\Helper\AssetsHelper</parameter>
<parameter key="templating.helper.actions.class">Symfony\Framework\FoundationBundle\Helper\ActionsHelper</parameter>
<parameter key="templating.helper.router.class">Symfony\Framework\FoundationBundle\Helper\RouterHelper</parameter>
<parameter key="templating.helper.request.class">Symfony\Framework\FoundationBundle\Helper\RequestHelper</parameter>
Expand Down Expand Up @@ -61,7 +61,7 @@

<service id="templating.helper.assets" class="%templating.helper.assets.class%">
<annotation name="templating.helper" alias="assets" />
<argument>%request.base_path%</argument>
<argument type="service" id="request" />
<argument />
<argument>%templating.assets.version%</argument>
</service>
Expand Down

0 comments on commit 95769bc

Please sign in to comment.