Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
Silex
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
Silex
Commits
f0656e0b
Commit
f0656e0b
authored
Mar 22, 2018
by
Haralan Dobrev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace twig.options defaults every time
Fixes
https://github.com/silexphp/Silex/issues/1577
parent
bc50a7e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
src/Silex/Provider/TwigServiceProvider.php
src/Silex/Provider/TwigServiceProvider.php
+5
-9
No files found.
src/Silex/Provider/TwigServiceProvider.php
View file @
f0656e0b
...
...
@@ -51,14 +51,6 @@ class TwigServiceProvider implements ServiceProviderInterface
$app
[
'twig.number_format.thousands_separator'
]
=
','
;
$app
[
'twig'
]
=
function
(
$app
)
{
$app
[
'twig.options'
]
=
array_replace
(
[
'charset'
=>
$app
[
'charset'
],
'debug'
=>
$app
[
'debug'
],
'strict_variables'
=>
$app
[
'debug'
],
],
$app
[
'twig.options'
]
);
$twig
=
$app
[
'twig.environment_factory'
](
$app
);
// registered for BC, but should not be used anymore
// deprecated and should probably be removed in Silex 3.0
...
...
@@ -172,7 +164,11 @@ class TwigServiceProvider implements ServiceProviderInterface
};
$app
[
'twig.environment_factory'
]
=
$app
->
protect
(
function
(
$app
)
{
return
new
\Twig_Environment
(
$app
[
'twig.loader'
],
$app
[
'twig.options'
]);
return
new
\Twig_Environment
(
$app
[
'twig.loader'
],
array_replace
([
'charset'
=>
$app
[
'charset'
],
'debug'
=>
$app
[
'debug'
],
'strict_variables'
=>
$app
[
'debug'
],
],
$app
[
'twig.options'
]));
});
$app
[
'twig.runtime.httpkernel'
]
=
function
(
$app
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment