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

Added docs for the SessionValueResolver#7322

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

Closed
linaori wants to merge2 commits intosymfony:masterfromlinaori:feature/session-avr

Conversation

@linaori
Copy link
Contributor

Explains the functionality added insymfony/symfony#21164

@xabbuhxabbuh added this to the3.3 milestoneJan 8, 2017

use Symfony\Component\HttpFoundation\Request;
..versionadded::3.3
The ability to request a ``Session`` in actions was introduced in Symfony 3.
Copy link
Contributor

Choose a reason for hiding this comment

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

3.3

@linaori
Copy link
ContributorAuthor

Rebased and addressed the remark.@xabbuh I forgot to link to this PR in the feature PR, but now that it's merged, theOn hold can be removed.

@xabbuhxabbuh removed the On hold labelFeb 27, 2017

use Symfony\Component\HttpFoundation\Session\Session;

public function indexAction(Session $session)
Copy link
Member

Choose a reason for hiding this comment

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

What about usingSessionInterface instead?

public function indexAction(Request $request)
{
$session = $request->getSession();
To retrieve the session, add the:class:`Symfony\\Component\\HttpFoundation\\Session\\Session`
Copy link
Contributor

Choose a reason for hiding this comment

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

What about:
"To retrieve the session, type hint a controller argument with :class:Symfony\\Component\\HttpFoundation\\Session\\SessionInterface or any implementation:"
?
Then keep the example below which is much more useful to get access to method not available through the interface.

@linaori
Copy link
ContributorAuthor

I've addressed the comments and added a small example of how to use theSession instead of theSessionInterface forgetFlashBag

Copy link
Contributor

@HeahDudeHeahDude left a comment

Choose a reason for hiding this comment

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

👍

@HeahDude
Copy link
Contributor

This one is not on hold anymore,symfony/symfony#21164 is merged.

Copy link
Member

@wouterjwouterj left a comment

Choose a reason for hiding this comment

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

Thanks! Left 2 minor comments that can be applied during the merge.

Every ``SessionInterface`` implementation is supported. If you have your
own implementation, type-hint this in the arguments instead.

As a developer, you might prefer not to extend the ``Controller``. To use the
Copy link
Member

Choose a reason for hiding this comment

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

This paragraph should be moved to the end of the next section ("Flash Messages") and can maybe be put in a.. sidebar:: or.. tip:: directive instead.

..versionadded::3.3
The ``SessionValueResolver`` was introduced in Symfony 3.3.

Symfony ships with four value resolvers in the HttpKernel component:
Copy link
Member

Choose a reason for hiding this comment

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

four -> five

@xabbuh
Copy link
Member

Thank you@iltar.

xabbuh added a commit that referenced this pull requestApr 15, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@xabbuhxabbuhxabbuh left review comments

@wouterjwouterjwouterj approved these changes

+2 more reviewers

@GuilhemNGuilhemNGuilhemN left review comments

@HeahDudeHeahDudeHeahDude approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

3.3

Development

Successfully merging this pull request may close these issues.

6 participants

@linaori@HeahDude@xabbuh@wouterj@GuilhemN@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp