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

[create_framework] Add missing extract() 2nd arg#5522

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
wouterj merged 1 commit intosymfony:2.3fromkenjis:patch-2
Aug 20, 2015

Conversation

@kenjis
Copy link
Contributor

See previous page:http://symfony.com/doc/2.3/create_framework/templating.html

The code isextract($request->attributes->all(), EXTR_SKIP);.

In this page, suddenlyEXTR_SKIP is missing. I don't know why.

@javiereguiluz
Copy link
Member

@kenjis 👍 thanks for reporting this error.

I can confirm this is an error. Inthe original article at Fabien's website, theEXTR_SKIP argument was present:

extr_skip_argument

@xabbuh
Copy link
Member

@javiereguiluz The page that@kenjis changed is actualpart 6, but I agree that it should be fixed here (usingextract() might generally not be the best idea though).

@xabbuh
Copy link
Member

Hm, actually I think it's right to not specify an argument here. The reason this was done in the previos chapters is that the default behaviour ofextract() is to overwrite any existing variables with the same name. However, this is not a good idea in the global context as we might lose our very own framework variables. But this isn't issue anymore in the present code as theextract() call is wrapped in therender_template() function.

@kenjis
Copy link
ContributorAuthor

@xabbuh theextract() has moved into a function on prev page:http://symfony.com/doc/2.3/create_framework/templating.html
So if we removeEXTR_SKIP, we should do on prev page and add why.

@xabbuh
Copy link
Member

@kenjis Yeah, I agree that it should simply be removed on the previous page.

@wouterj
Copy link
Member

Hi@kenjis! Thanks for the original fix and the discussion that came with it. As we concluded that the better fix would be to remove the argument from the templating guide, I've taken your commit and changed it so it can be merged:#5568

So I'm closing this PR, but you still get all the credits!

wouterj added a commit that referenced this pull requestJul 28, 2015
…njis)This PR was merged into the 2.3 branch.Discussion----------[Create Framework] Fix extract calls (replaces#5522)Commits-------a9d75c6 Fix code
@wouterjwouterj reopened thisAug 20, 2015
@wouterj
Copy link
Member

Good news! We decided to add this argument to the other examples again, as it prevents overriding the$request variable. So it makes perfectly sense to merge this PR now. Thank you for creating it.

@wouterjwouterj merged commit0905395 intosymfony:2.3Aug 20, 2015
wouterj added a commit that referenced this pull requestAug 20, 2015
This PR was merged into the 2.3 branch.Discussion----------[create_framework] Add missing extract() 2nd argSee previous page:http://symfony.com/doc/2.3/create_framework/templating.htmlThe code is `extract($request->attributes->all(), EXTR_SKIP);`.In this page, suddenly `EXTR_SKIP` is missing. I don't know why.Commits-------0905395 Fix code
@kenjis
Copy link
ContributorAuthor

My pleasure.

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@kenjis@javiereguiluz@xabbuh@wouterj

[8]ページ先頭

©2009-2025 Movatter.jp