Skip to content

Commit

Permalink
[FrameworkBundle] tweak Templating
Browse files Browse the repository at this point in the history
  • Loading branch information
vicb authored and fabpot committed Feb 15, 2011
1 parent 7a2522b commit 5eee0db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Expand Up @@ -35,12 +35,14 @@ class TemplatePathsCacheWarmer extends CacheWarmer
*
* @param KernelInterface $kernel A KernelInterface instance
* @param FileLocatorInterface $locator A FileLocatorInterface instance
* @param TemplateNameParser $parser A TemplateNameParser instance
* @param string $rootDir The directory where global templates can be stored
*/
public function __construct(KernelInterface $kernel, FileLocatorInterface $locator, $rootDir)
public function __construct(KernelInterface $kernel, FileLocatorInterface $locator, TemplateNameParser $parser, $rootDir)
{
$this->kernel = $kernel;
$this->locator = $locator;
$this->parser = $parser;
$this->rootDir = $rootDir;
}

Expand Down Expand Up @@ -97,11 +99,7 @@ protected function computeTemplatePaths()
}

protected function parseTemplateName($file, $prefix, $bundle = '')
{
if (null === $this->parser) {
$this->parser = $this->kernel->getContainer()->get('templating.name_parser');
}

{
$prefix = strtr($prefix, '\\', '/');
$path = strtr($file->getPathname(), '\\', '/');

Expand Down
Expand Up @@ -40,6 +40,7 @@
<service id="templating.cache_warmer.template_paths" class="%templating.cache_warmer.template_paths.class%" public="false">
<argument type="service" id="kernel" />
<argument type="service" id="file_locator" />
<argument type="service" id="templating.name_parser" />
<argument>%kernel.root_dir%/views</argument>
</service>

Expand Down

0 comments on commit 5eee0db

Please sign in to comment.