-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
TemplateController: extra arguments passed to the template are not managed by Symfony #12897
Comments
You're right, this part is not currently supported: # optionally you can define some arguments passed to the template
site_name: 'ACME'
theme: 'dark' but it looks like a good feature to me :) |
Oh yes that would be great.
Le mar. 7 janv. 2020 à 18:27, Yonel Ceruto <notifications@github.com> a
écrit :
… You're right, this part is not currently supported:
# optionally you can define some arguments passed to the templatesite_name: 'ACME'theme: 'dark'
but it looks like a good feature to me :)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#12897?email_source=notifications&email_token=AAJFMWY3K76BVQDCVCQ5UH3Q4S3PPA5CNFSM4KD3POY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIJUGUI#issuecomment-571687761>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJFMW4VJEATCLVWDYUVH2LQ4S3PPANCNFSM4KD3POYQ>
.
|
fabpot
added a commit
to symfony/symfony
that referenced
this issue
Jan 10, 2020
…ra arguments to be sent to the template (Benjamin RICHARD) This PR was squashed before being merged into the 5.1-dev branch (closes #35257). Discussion ---------- [FrameworkBundle] TemplateController should accept extra arguments to be sent to the template | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | Fix #... <!-- prefix each issue number with "Fix #", if any --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> <!-- Replace this notice by a short README for your feature/bugfix. This will help people understand your PR and can be used as a start for the documentation. Additionally (see https://symfony.com/roadmap): - Always add tests and ensure they pass. - Never break backward compatibility (see https://symfony.com/bc). - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too.) - Features and deprecations must be submitted against branch master. --> In the official documentation (symfony.com/doc/master/templates.html#rendering-a-template-directly-from-a-route) it says that TemplateController should accept extra arguments. In fact it's not available for instance. So i added the context argument as an array. Because of deprecation of templating, only the twig instance will apply the context argument. It will need to be implemented in branch 5. The following issue has been created in documentation project : symfony/symfony-docs#12897 Commits ------- e27b417 [FrameworkBundle] TemplateController should accept extra arguments to be sent to the template
symfony-splitter
pushed a commit
to symfony/framework-bundle
that referenced
this issue
Jan 10, 2020
…ra arguments to be sent to the template (Benjamin RICHARD) This PR was squashed before being merged into the 5.1-dev branch (closes #35257). Discussion ---------- [FrameworkBundle] TemplateController should accept extra arguments to be sent to the template | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | Fix #... <!-- prefix each issue number with "Fix #", if any --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> <!-- Replace this notice by a short README for your feature/bugfix. This will help people understand your PR and can be used as a start for the documentation. Additionally (see https://symfony.com/roadmap): - Always add tests and ensure they pass. - Never break backward compatibility (see https://symfony.com/bc). - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too.) - Features and deprecations must be submitted against branch master. --> In the official documentation (symfony.com/doc/master/templates.html#rendering-a-template-directly-from-a-route) it says that TemplateController should accept extra arguments. In fact it's not available for instance. So i added the context argument as an array. Because of deprecation of templating, only the twig instance will apply the context argument. It will need to be implemented in branch 5. The following issue has been created in documentation project : symfony/symfony-docs#12897 Commits ------- e27b417817 [FrameworkBundle] TemplateController should accept extra arguments to be sent to the template
Will be fixed in next symfony release |
See #12929 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Playing with TemplateController, i saw in the documentation https://symfony.com/doc/master/templates.html#rendering-a-template-directly-from-a-route that i may send extra arguments
In fact, those extra arguments seems not managed by the TemplateController following the source code https://github.com/symfony/symfony/blob/5.0/src/Symfony/Bundle/FrameworkBundle/Controller/TemplateController.php (same for 4.*)
Maybe the documentation is not enough explicit about what those extra arguments are used byt Symfony, if they are.
The text was updated successfully, but these errors were encountered: