Skip to content

[3.4] Update logic for controller action arguments #8559

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

Merged
merged 1 commit into from
Nov 2, 2017
Merged

[3.4] Update logic for controller action arguments #8559

merged 1 commit into from
Nov 2, 2017

Conversation

weaverryan
Copy link
Member

I haven't used binding yet, but I believe this is correct. @yceruto does this look good to you? You have more experience with bind than I do :).

---------------------------------

You can also use the ``bind`` keyword to bind specific arguments by name or type.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a poor bootstrap of the bind section, just so I can link to it. i've commented in the issue about that feature (#8276) to note that this was created.

Copy link
Member

@javiereguiluz javiereguiluz left a comment

Choose a reason for hiding this comment

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

This looks OK to me ... but it's missing one of the most important reasons to use bind: define the scalar arguments once instead of repeating them in several services. It's explained in the first part of this blog post: https://symfony.com/blog/new-in-symfony-3-4-local-service-binding

Copy link
Member

@yceruto yceruto left a comment

Choose a reason for hiding this comment

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

Yeah, it look great!

@weaverryan
Copy link
Member Author

@javiereguiluz It was tricky when I talked about bind for the controller args... as I could have shown a bind on just that one service (a bit more clear... but kinda less useful) or apply a bind to _defaults, which is awesome, but might be a little less clear. I'm not sure what the right thing is.

But, we will of course talk about that a lot more in the service_container.rst chapter... which I hope we will turn into a "getting started" guide ;)

@weaverryan weaverryan merged commit 533945c into symfony:3.4 Nov 2, 2017
weaverryan added a commit that referenced this pull request Nov 2, 2017
…verryan)

This PR was merged into the 3.4 branch.

Discussion
----------

[3.4] Update logic for controller action arguments

I haven't used binding yet, but I believe this is correct. @yceruto does this look good to you? You have more experience with bind than I do :).

Commits
-------

533945c updating controller scalar args for 3.4
@weaverryan weaverryan deleted the controller-scalar-args-3.4 branch November 2, 2017 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants