Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[FrameworkBundle] TemplateController should accept extra arguments to be sent to the template#35257

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:masterfromRebolon:rebolon/template-controller-add-context
Jan 10, 2020
Merged

[FrameworkBundle] TemplateController should accept extra arguments to be sent to the template#35257

fabpot merged 1 commit intosymfony:masterfromRebolon:rebolon/template-controller-add-context
Jan 10, 2020

Conversation

Rebolon
Copy link

@RebolonRebolon commentedJan 8, 2020
edited by yceruto
Loading

QA
Branch?master
Bug fix?no
New feature?yes
Deprecations?no
TicketsFix #...
LicenseMIT
Doc PRsymfony/symfony-docs#...

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

Copy link
Member

@ycerutoyceruto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Hi@Rebolon, thanks for taking care of this. I left some comments to make your "first contribution" happy :)

  1. The target branch must bemaster for new features (future 5.1),4.4 is already released and must be used for bugfix only. Please, rebase it tomaster.
  2. A functional test case is required for new features like this one.

Don't hesite to ask any question, thanks again.

@Rebolon
Copy link
Author

@yceruto thx for help.
Not sure to get time for the Functional Test. I understand the goal, but not sure how to achieve it throught this project in short time (i'm looking for it).

@yceruto
Copy link
Member

Not sure to get time for the Functional Test. I understand the goal, but not sure how to achieve it throught this project in short time (i'm looking for it).

Don't worry about it, I can add it at the end, just let me know when the other comments have been fixed. Thanks!

@Rebolon
Copy link
Author

@yceruto it should be ok right now
I added an Integration Test as i needed Twig. If you consider you need a Functional Test, it's up to you, or just give me tips on the wished usage (WebTestCase or Panther, anything else)

@RebolonRebolon requested a review fromycerutoJanuary 8, 2020 17:06
@yceruto
Copy link
Member

Wow! you were fast ⚡ :)

An unit test is enough for me, but can you confirm that this is the new route config for this feature?

# config/routes.yamlacme_privacy:path:/privacycontroller:Symfony\Bundle\FrameworkBundle\Controller\TemplateControllerdefaults:template:'static/privacy.html.twig'maxAge:86400sharedAge:86400# optionally you can define some arguments passed to the templatecontext:site_name:'ACME'theme:'dark'
Rebolon reacted with thumbs up emoji

Copy link
Member

@ycerutoyceruto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Look good to me after minor comment, thanks!

@Rebolon
Copy link
Author

Rebolon commentedJan 9, 2020
edited
Loading

@yceruto That's it for the yaml config.
I pushed the last changes following your review.

Copy link
Member

@chalasrchalasr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

with minor comment

Rebolon reacted with thumbs up emoji
@nicolas-grekas
Copy link
Member

(please fix fabbot's report)

@fabpot
Copy link
Member

Thank you@Rebolon.

Rebolon reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ycerutoycerutoyceruto approved these changes

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@chalasrchalasrchalasr approved these changes

@dunglasdunglasAwaiting requested review from dunglas

@lyrixxlyrixxAwaiting requested review from lyrixx

@srozesrozeAwaiting requested review from sroze

@xabbuhxabbuhAwaiting requested review from xabbuh

Assignees
No one assigned
Projects
None yet
Milestone
5.1
Development

Successfully merging this pull request may close these issues.

6 participants
@Rebolon@yceruto@nicolas-grekas@fabpot@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp