10000 [Templating] #9071 array param for EngineInterface::render() by jillro · Pull Request #10832 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Templating] #9071 array param for EngineInterface::render() #10832

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

Closed
wants to merge 1 commit into from

Conversation

jillro
Copy link
@jillro jillro commented May 1, 2014
Q A
Bug fix? no
New feature? yes
BC breaks? ?
Deprecations? no
Tests pass? yes
Fixed tickets #9071
License MIT
Doc PR
  • submit changes to the documentation

We allow an array to be given as param to Symfony/Component/Templating/EngineInterface::render() and Symfony/Bundle/FrameworkBundle/Templating/EngineInterface::renderView(). We modify Symfony\Bridge\Twig\TwigEngine so it accepts an array as param to TwigEngine::render(). We add a test for that. Controller:render() and ::renderView() now accept array as parameter.

This change asks implementer of EngineInterface::render() to accept arrays as parameters, but it will never break existing code, as it is just a change in the docblock, so I do not know if it is a BC break.

We allow an array to be given as param to
Symfony/Component/Templating/EngineInterface::render()
and Symfony/Bundle/FrameworkBundle/Templating
/EngineInterface::renderView(). We modify Symfony\Bridge
\Twig\TwigEngine so it accepts an array as param to
TwigEngine::render(). We add a test for that.
Controller:render() and ::renderView() now accept array as
parameter.
@stof
Copy link
Member
stof commented May 1, 2014

This is a BC break, as it changes the EngineInterface (an engine is now supposed to accept arrays as well)

@jillro
Copy link
Author
jillro commented May 1, 2014

Ok, I was expecting that.

In this case, I think it is impossible to fix #9071 without :

  • introducing a BC break in EngineInterface
    or
  • coupling Symfony/Bundle/FrameworkBundle/Controller/Controller directly with Twig (Twig_Environment::resolveTemplate())

Neither of those seem an acceptable solution.

@Koc
Copy link
Contributor
Koc commented May 5, 2014

BC-break will occurs only in some edge cases. If your engine implementation doesn't supports arrays, so you probably don't know about this feature and not use it.

@stof
Copy link
Member
stof commented May 5, 2014

@Koc Teh issue is that if we update the interface to accept arrays, all implementations need to accept them. Otherwise, consumers of the interface would not be able to use arrays.

and for instance, the delegating engine does not support arrays in this PR, so you cannot use them anymore if you enable several engines

@fabpot
Copy link
Member
fabpot commented Jun 3, 2014

And the PHP engine does not support that either. So, I'm closing this as the BC break is not worth it.

Talking about templating engines, I would really like to remove support for PHP at some point to avoid this additional layer we have right now that prevents to take advantages of some nice Twig features. But that's probably for 3.0 if ever.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0