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

[TwigBridge] Added access to token from twig AppVariable#19991

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:masterfromHeahDude:feature/twig-app_token
Oct 5, 2016

Conversation

@HeahDude
Copy link
Contributor

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets~
LicenseMIT
Doc PRTODO

In Symfony 2.x we could access the token fromapp.security but now we can only get the user even if it comes from the token storage.

This makes mandatory to create a custom twig extension to access it and thus harder to update to symfony 3.x when you need this simple getter in a template where custom tokens are involved (e.g using a ConnectToken from SensioLabs Connect API).

I hope this little feature will be part of 3.2 :)

ro0NL reacted with thumbs up emoji
*/
publicfunctiongetUser()
{
if (null !==$this->tokenStorage) {

Choose a reason for hiding this comment

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

not sure this change is needed, and it forces the error message to be less specific

Copy link
Contributor

Choose a reason for hiding this comment

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

It's moved to thegetToken() method.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I see what you mean now. Indeed the message will not be specific to the user anymore (will be about token). I'd indeed keep the check and throw an exception like before.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

fair enough

@HeahDude
Copy link
ContributorAuthor

Comments addressed.

@fabpot
Copy link
Member

Thank you@HeahDude.

@fabpotfabpot merged commitefd3e2d intosymfony:masterOct 5, 2016
fabpot added a commit that referenced this pull requestOct 5, 2016
…le (HeahDude)This PR was merged into the 3.2-dev branch.Discussion----------[TwigBridge] Added access to token from twig AppVariable| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | ~| License       | MIT| Doc PR        | TODOIn Symfony 2.x we could access the token from `app.security` but now we can only get the user even if it comes from the token storage.This makes mandatory to create a custom twig extension to access it and thus harder to update to symfony 3.x when you need this simple getter in a template where custom tokens are involved (e.g using a ConnectToken from SensioLabs Connect API).I hope this little feature will be part of 3.2 :)Commits-------efd3e2d Added access to token from twig AppVariable
@HeahDudeHeahDude deleted the feature/twig-app_token branchOctober 5, 2016 06:30
@fabpotfabpot mentioned this pull requestOct 27, 2016
fabpot added a commit that referenced this pull requestDec 13, 2016
…eahDude)This PR was merged into the 3.3-dev branch.Discussion----------[FrameworkBundle] Added GlobalVariables::getToken()| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |symfony/symfony-docs#7191 comments| License       | MIT| Doc PR        |symfony/symfony-docs#7191I propose this feature as bug fix in 3.2, since I don't use the PHP templating I forgot to add the method in the `FrameworkBundle`, to keep it align with the `TwigBridge` in#19991.Is this acceptable or should it go in master?Commits-------099b848 Added GlobalVariables::getToken()
symfony-splitter pushed a commit to symfony/framework-bundle that referenced this pull requestDec 13, 2016
…eahDude)This PR was merged into the 3.3-dev branch.Discussion----------[FrameworkBundle] Added GlobalVariables::getToken()| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |symfony/symfony-docs#7191 comments| License       | MIT| Doc PR        |symfony/symfony-docs#7191I propose this feature as bug fix in 3.2, since I don't use the PHP templating I forgot to add the method in the `FrameworkBundle`, to keep it align with the `TwigBridge` insymfony/symfony#19991.Is this acceptable or should it go in master?Commits-------099b848 Added GlobalVariables::getToken()
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

+1 more reviewer

@jakzaljakzaljakzal left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@HeahDude@fabpot@jakzal@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp