Skip to content

Commit a0b3270

Browse files
committed
Twig_Loader_String is now deprecated - #84
1 parent 59b4325 commit a0b3270

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

src/JonnyW/PhantomJs/Resources/config/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ parameters:
5252
phantomjs.template.template_renderer.class: JonnyW\PhantomJs\Template\TemplateRenderer
5353
phantomjs.twig.environment.class: Twig_Environment
5454
phantomjs.twig.lexer.class: Twig_Lexer
55-
phantomjs.twig.string_loader.class: Twig_Loader_String
55+
phantomjs.twig.array_loader.class: Twig_Loader_Array
5656

5757
##################
5858
### RESOURCES ####

src/JonnyW/PhantomJs/Resources/config/services.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,13 @@ services:
128128
phantomjs.twig.environment:
129129
class: "%phantomjs.twig.environment.class%"
130130
arguments:
131-
- "@phantomjs.twig.string_loader"
131+
- "@phantomjs.twig.array_loader"
132132
public: false
133133

134-
phantomjs.twig.string_loader:
135-
class: "%phantomjs.twig.string_loader.class%"
134+
phantomjs.twig.array_loader:
135+
class: "%phantomjs.twig.array_loader.class%"
136+
arguments:
137+
- []
136138
public: false
137139

138140
phantomjs.procedure.template_renderer:
@@ -144,7 +146,7 @@ services:
144146
phantomjs.procedure.twig.environment:
145147
class: "%phantomjs.twig.environment.class%"
146148
arguments:
147-
- "@phantomjs.twig.string_loader"
149+
- "@phantomjs.twig.array_loader"
148150
public: false
149151
calls:
150152
- [ "setLexer", [ "@phantomjs.procedure.twig.lexer" ] ]

src/JonnyW/PhantomJs/Template/TemplateRenderer.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ public function __construct(\Twig_Environment $twig)
4444
*/
4545
public function render($template, array $context = array())
4646
{
47-
return $this->twig->render($template, $context);
47+
$template = $this->twig->createTemplate($template);
48+
49+
return $template->render($context);
4850
}
4951
}

0 commit comments

Comments
 (0)