-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
The templating-related shortcuts in the base controller should be usable without the Templating component #15502
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
Comments
👍
|
why not removing the deps in TwigEngine instead ? |
@aitboudad TwigEngine is only about implementing the interface of the Templating component on top of Twig. Removing the deps in it does not make sense, as it is its goal. |
IMO the templating component dependency cannot be removed until 3.0 in order to keep BC. If Twig it's the only enabled engine, we can use it, if not, we should use the templating component. Also, the template path is different when using Twig or the Templating component, so, doing this automatically can be a BC break. |
@dosten I'm not asking to stop using the templating component when it is available. I'm asking to be able to use the shortcuts when it is not. and no, the template name is not different. You can have more syntaxes when using Twig directly (but this is also the case when Twig is the only engine enabled), but the |
Does anybody know what also missing when we using native twig without Templating component? For example stopwatch. |
@Koc I think everything will still be available. Currently, lots of things are duplicated for Templating and Twig |
@stof what can you suggest? In what directions should i moving for adding stopwatch? I have only one sollution: override base template class and override render method. |
@Koc can't you decorate the Twig_Environment and add the stopwatch functionality? |
maybe. Also should look into node visitors http://php-and-symfony.matthiasnoback.nl/2013/01/symfony2-twig-collecting-data-across-templates-using-a-node-visitor/ |
… Templating component (Koc) This PR was squashed before being merged into the 2.8 branch (closes #15620). Discussion ---------- [WIP] #15502 Make template shortcuts be usable without Templating component | Q | A | ------------- | --- | Bug fix? | yes | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | ? | Fixed tickets | #15502 | License | MIT | Doc PR | - Commits ------- d547ec0 [WIP] #15502 Make template shortcuts be usable without Templating component
Please do not close this ticket because some other features are missing, loke Stopwatch integration. |
@Koc Can you create another issue for Stopwatch? and close this one because this one is not about Stopwatch (except if you carefully read the whole discussion :)). |
Ok, will do |
* 2.8: (31 commits) [DomCrawler] Invalid uri created from forms if base tag present [VarDumper] Add caster for OuterIterator objects [Console] update param type phpdoc for StreamOutput [Console] fix typo in OutputInterface Use stderr by default when a specific output is not injected fixed bad merge [Debug] Fix case mismatch detection [HttpKernel] Add entry point to more easily create/configure the DI extension [DX] Added a logout link in the security panel of the web debug toolbar [HttpKernel] fix broken multiline <esi:remove> [DoctrineBridge] Fixed #14840 [FrameworkBundle] add a suggest for the serializer component fixed CS removed non-working tests [WIP] #15502 Make template shortcuts be usable without Templating component Redesigned the Symfony Profiler [Yaml] Fix the parsing of float keys Make the exception output visible even in quiet mode, fixes #15680 Convert Output::write's type to an options arg where verbosity can be passed in as well [Console] Ensure the console output is only detected as decorated when both stderr and stdout support colors ...
…the Templating component (dunglas) This PR was merged into the 2.8 branch. Discussion ---------- [FrameworkBundle] Make TemplateController working without the Templating component | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a The template controller was missed during #15502. Btw I've added some tests for this controller. Commits ------- 89ccbc4 [FrameworkBundle] Make TemplateController working without the Templating component
* 2.8: (31 commits) [DomCrawler] Invalid uri created from forms if base tag present [VarDumper] Add caster for OuterIterator objects [Console] update param type phpdoc for StreamOutput [Console] fix typo in OutputInterface Use stderr by default when a specific output is not injected fixed bad merge [Debug] Fix case mismatch detection [HttpKernel] Add entry point to more easily create/configure the DI extension [DX] Added a logout link in the security panel of the web debug toolbar [HttpKernel] fix broken multiline <esi:remove> [DoctrineBridge] Fixed symfony#14840 [FrameworkBundle] add a suggest for the serializer component fixed CS removed non-working tests [WIP] symfony#15502 Make template shortcuts be usable without Templating component Redesigned the Symfony Profiler [Yaml] Fix the parsing of float keys Make the exception output visible even in quiet mode, fixes symfony#15680 Convert Output::write's type to an options arg where verbosity can be passed in as well [Console] Ensure the console output is only detected as decorated when both stderr and stdout support colors ...
In Symfony 2.7, we made it possible to use most features of Symfony without enabling the templating component (assuming you don't use a bundle relying on them of course).
However, we have 3 shortcut methods in the base controller which are not compatible with such setup and force the usage of the templating component:
render
renderView
stream
Most projects based on Symfony are probably relying on them, as this is the documented way to render templates.
All of them can be implemented on top of Twig directly quite easily. I suggest doing this in 2.8 in case the templating component is not available.
The text was updated successfully, but these errors were encountered: