Skip to content

Commit 0313e7a

Browse files
committed
feature #393 Updated to Symfony 3.2 BETA1 (javiereguiluz)
This PR was squashed before being merged into the master branch (closes #393). Discussion ---------- Updated to Symfony 3.2 BETA1 The beta1 of Symfony 3.2 has just been released, so let's upgrade the Symfony Demo to catch bugs and deprecations before the final release. Commits ------- 1caf537 Updated to Symfony 3.2 BETA1
2 parents 690ffb7 + 1caf537 commit 0313e7a

File tree

3 files changed

+30
-26
lines changed

3 files changed

+30
-26
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
"sensio/framework-extra-bundle" : "^3.0",
2424
"symfony/monolog-bundle" : "^2.8",
2525
"symfony/swiftmailer-bundle" : "^2.3",
26-
"symfony/symfony" : "^3.1",
26+
"symfony/symfony" : "^3.2-beta1",
2727
"twig/extensions" : "^1.3",
28-
"twig/twig" : "^1.25",
28+
"twig/twig" : "^1.27",
2929
"white-october/pagerfanta-bundle" : "^1.0"
3030
},
3131
"require-dev": {

composer.lock

Lines changed: 20 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/CodeExplorerBundle/Twig/SourceCodeExtension.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,16 @@ private function getCallableReflector($callable)
9999

100100
private function getTemplateSource(\Twig_Template $template)
101101
{
102+
$templateSource = $template->getSourceContext();
103+
102104
return [
103-
// Twig templates are not always stored in files, and so there is no
104-
// API to get the filename from a template name in a generic way.
105-
// The logic used here works only for templates stored in app/Resources/views
106-
// and referenced via the "filename.html.twig" notation, not via the "::filename.html.twig"
107-
// one or stored in bundles. This is enough for the needs of the demo app.
108-
'file_path' => $this->kernelRootDir.'/Resources/views/'.$template->getTemplateName(),
105+
// Twig templates are not always stored in files (they can be stored
106+
// in a database for example). However, for the needs of the Symfony
107+
// Demo app, we consider that all templates are stored in files and
108+
// that their file paths can be obtained through the source context.
109+
'file_path' => $templateSource->getPath(),
109110
'starting_line' => 1,
110-
'source_code' => $template->getSource(),
111+
'source_code' => $templateSource->getCode(),
111112
];
112113
}
113114

0 commit comments

Comments
 (0)