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
bf719221
Commit
bf719221
authored
Aug 23, 2013
by
Tobias Schultze
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small optimization
parent
1f1fc4e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
src/Silex/Application/TwigTrait.php
src/Silex/Application/TwigTrait.php
+3
-4
No files found.
src/Silex/Application/TwigTrait.php
View file @
bf719221
...
@@ -34,10 +34,6 @@ trait TwigTrait
...
@@ -34,10 +34,6 @@ trait TwigTrait
*/
*/
public
function
render
(
$view
,
array
$parameters
=
array
(),
Response
$response
=
null
)
public
function
render
(
$view
,
array
$parameters
=
array
(),
Response
$response
=
null
)
{
{
if
(
null
===
$response
)
{
$response
=
new
Response
();
}
$twig
=
$this
[
'twig'
];
$twig
=
$this
[
'twig'
];
if
(
$response
instanceof
StreamedResponse
)
{
if
(
$response
instanceof
StreamedResponse
)
{
...
@@ -45,6 +41,9 @@ trait TwigTrait
...
@@ -45,6 +41,9 @@ trait TwigTrait
$twig
->
display
(
$view
,
$parameters
);
$twig
->
display
(
$view
,
$parameters
);
});
});
}
else
{
}
else
{
if
(
null
===
$response
)
{
$response
=
new
Response
();
}
$response
->
setContent
(
$twig
->
render
(
$view
,
$parameters
));
$response
->
setContent
(
$twig
->
render
(
$view
,
$parameters
));
}
}
...
...
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