From ddf5ac44293255241768f9a23d6eddfdca0a103f Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 12 Feb 2015 13:06:55 +0100 Subject: [PATCH] made the assets optional --- .../DependencyInjection/FrameworkExtension.php | 3 ++- .../Tests/Functional/app/Resources/views/base.html.twig | 1 - .../TwigBundle/DependencyInjection/Compiler/ExtensionPass.php | 4 ++++ src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml | 1 - 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 8f7dc263fd5b8..44c1a168f9340 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -49,7 +49,6 @@ public function load(array $configs, ContainerBuilder $container) $loader->load('web.xml'); $loader->load('services.xml'); $loader->load('fragment_renderer.xml'); - $loader->load('assets.xml'); // A translator must always be registered (as support is included by // default in the Form component). If disabled, an identity translator @@ -562,6 +561,8 @@ private function registerTemplatingConfiguration(array $config, $ide, ContainerB */ private function registerAssetsConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader) { + $loader->load('assets.xml'); + $defaultVersion = $this->createVersion($container, $config['version'], $config['version_format'], '_default'); $defaultPackage = $this->createPackageDefinition($config['base_path'], $config['base_urls'], $defaultVersion); diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/Resources/views/base.html.twig b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/Resources/views/base.html.twig index 4b9151eaf877d..c3dddd319ba38 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/Resources/views/base.html.twig +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/Resources/views/base.html.twig @@ -4,7 +4,6 @@ {% block title %}Welcome!{% endblock %} {% block stylesheets %}{% endblock %} - {% block body %}{% endblock %} diff --git a/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php b/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php index 59662e8350497..309d435bf61c1 100644 --- a/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php +++ b/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php @@ -78,6 +78,10 @@ public function process(ContainerBuilder $container) $container->setDefinition('twig.loader.filesystem', $loader); } + if ($container->has('assets.packages')) { + $loader->addTag('twig.extension'); + } + if (method_exists('Symfony\Bridge\Twig\AppVariable', 'setContainer')) { // we are on Symfony <3.0, where the setContainer method exists $container->getDefinition('twig.app_variable')->addMethodCall('setContainer', array(new Reference('service_container'))); diff --git a/src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml b/src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml index 83bb14735d8d5..5c84d250596c6 100644 --- a/src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml +++ b/src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml @@ -86,7 +86,6 @@ - pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy