You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: core/events.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -64,11 +64,11 @@ final class BookMailSubscriber implements EventSubscriberInterface
64
64
}
65
65
```
66
66
67
-
If you use the official API Platform distribution, creating the previous class is enough. [DunglasActionBundle](https://github.com/dunglas/DunglasActionBundle)
68
-
(installed by default) will automatically register this subscriber as a service and will inject its dependencies using [the
69
-
autowiring feature of the Symfony Dependency Injection Container](http://symfony.com/doc/current/components/dependency_injection/autowiring.html).
67
+
If you use the official API Platform distribution, creating the previous class is enough. The Symfony Dependency Injection
68
+
component will automatically register this subscriber as a service and will inject its dependencies thanks to the[autowiring
If you don't have DunglasActionBundle installed, [the subscriber must be registered manually](http://symfony.com/doc/current/components/http_kernel/introduction.html#creating-an-event-listener).
71
+
Alternatively, [the subscriber must be registered manually](http://symfony.com/doc/current/components/http_kernel/introduction.html#creating-an-event-listener).
Copy file name to clipboardExpand all lines: core/operations.md
+7-10Lines changed: 7 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ API Platform Core relies on the concept of operations. Operations can be applied
4
4
an implementation point of view, an operation is a link between a resource, a route and its related controller.
5
5
6
6
API Platform automatically registers typical [CRUD](https://en.wikipedia.org/wiki/Create,_read,_update_and_delete) operations
7
-
and describes them in the exposed documentation (Hydra and NelmioApiDoc). It also creates and registers routes corresponding
7
+
and describes them in the exposed documentation (Hydra and Swagger). It also creates and registers routes corresponding
8
8
to these operations in the Symfony routing system (if it is available).
9
9
10
10
The behavior of built-in operations is briefly presented in the [Getting started](getting-started.md#mapping-the-entities)
@@ -353,15 +353,12 @@ implements the [Action-Domain-Responder](https://github.com/pmjones/adr) pattern
353
353
354
354
Note: [the event system](events.md) should be preferred over custom controllers when applicable.
355
355
356
-
The distribution of API Platform also comes with an enhanced action system for Symfony pre-installed: [DunglasActionBundle](https://github.com/dunglas/DunglasActionBundle).
357
-
*DunglasActionBundle* eases the implementation of the ADR pattern with Symfony and improves the developer experience.
358
-
359
-
It automatically registers action classes stored in `src/*Bundle/Action` and `src/*Bundle/Controller` directories as autowired
360
-
services.
356
+
The distribution of API Platform also eases the implementation of the ADR pattern: it automatically registers action classes
357
+
stored in `src/AppBundle/Action` and `src/AppBundle/Controller` as autowired services.
361
358
362
359
Thanks to the [autowiring](http://symfony.com/doc/current/components/dependency_injection/autowiring.html) feature of the
363
-
Symfony dependency injection container, services required by an action can be type-hinted in its controller, it will be automatically
364
-
instantiated and injected, without having to declare it explicitly.
360
+
Symfony Dependency Injection container, services required by an action can be type-hinted in its constructor, it will be
361
+
automatically instantiated and injected, without having to declare it explicitly.
365
362
366
363
In the following example, the built-in `GET` operation is registered as well as a custom operation called `special`.
367
364
The `special` operation reference the Symfony route named `book_special`.
@@ -473,8 +470,8 @@ It is mandatory to set the `_api_resource_class` and `_api_item_operation_name`
473
470
operation) in the parameters of the route (`defaults` key). It allows API Platform and the Symfony routing system to hook
474
471
together.
475
472
476
-
Here we consider that DunglasActionBundle is installed (the default when using the API Platform distribution). This
477
-
action will be automatically registered as a service (the service name is the same as the class name: `AppBundle\Action\BookSpecial`).
473
+
Here we consider that the autowiring enabled for controller classes (the default when using the API Platform distribution).
474
+
This action will be automatically registered as a service (the service name is the same as the class name: `AppBundle\Action\BookSpecial`).
478
475
479
476
API Platform automatically retrieves the appropriate PHP entity then deserializes it, and for `POST` and `PUT` requests
480
477
updates the entity with data provided by the user.
0 commit comments