8000 made the assets optional by fabpot · Pull Request #13667 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

made the assets optional #13667

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 12, 2015
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
made the assets optional
  • Loading branch information
fabpot committed Feb 12, 2015
commit ddf5ac44293255241768f9a23d6eddfdca0a103f
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<meta charset="UTF-8" />
<title>{% block title %}Welcome!{% endblock %}</title>
{% block stylesheets %}{% endblock %}
<link rel="shortcut icon&quo 8000 t; href="{{ asset('favicon.ico') }}" />
</head>
<body>
{% block body %}{% endblock %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ public function process(ContainerBuilder $container)
$container->setDefinition('twig.loader.filesystem', $loader);
}

if ($container->has('assets.packages')) {
$loader->addTag('twig.extension');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be?

$container->getDefinition('twig.extension.assets')->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')));
Expand Down
1 change: 0 additions & 1 deletion src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
</service>

<service id="twig.extension.assets" class="Symfony\Bridge\Twig\Extension\AssetExtension" public="false">
<tag name="twig.extension" />
<argument type="service" id="assets.packages" />
<argument type="service" id="twig.extension.httpfoundation" />
</service>
Expand Down
0