From dacc1681e31113646d88588a19b56adde6f24281 Mon Sep 17 00:00:00 2001 From: Abdellatif Ait boudad Date: Wed, 27 Dec 2017 16:49:40 +0000 Subject: [PATCH] [doc DTO] add define custom loader paths step. --- core/dto.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/core/dto.md b/core/dto.md index 4d240e83a61..85f76f9294f 100644 --- a/core/dto.md +++ b/core/dto.md @@ -42,7 +42,17 @@ In this case, we disable all operations except `POST`. Then, thanks to [the event system](events.md), it's possible to intercept the `POST` request and to handle it. -First, an event subscriber is needed: +First, we should define a custom loader paths and create an event subscriber: + +* define a custom loader paths for `Api/Dto`: + +```yaml +api_platform: + mapping: + paths: ['%kernel.project_dir%/src/Api/Dto'] +``` + +* create an event subscriber: ```php