Skip to content

Custom operation: enhancing the visibility of an important remark #589

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 2 commits into from
Sep 21, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion core/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,8 @@ This action will be automatically registered as a service (the service name is t

API Platform automatically retrieves the appropriate PHP entity using the data provider then deserializes user data in it,
and for `POST` and `PUT` requests updates the entity with data provided by the user.
By convention, the action's parameter must be called `$data`.

**Warning: the `__invoke()` method parameter [MUST be called `$data`](https://symfony.com/doc/current/routing/extra_information.html)**, otherwise, it will not be filled correctly!

Services (`$myService` here) are automatically injected thanks to the autowiring feature. You can type-hint any service
you need and it will be autowired too.
Expand Down