Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9fb2e9f

Browse files
committed
minor EasyCorp#1085 Updated the tutorial about FOSRestBundle integration (Yunyun548, javiereguiluz)
This PR was merged into the master branch. Discussion ---------- Updated the tutorial about FOSRestBundle integration This finishes EasyCorp#1083 with the comments provided by @ogizanagi and @xabbuh. Commits ------- d391975 Reworded the article a4d5b45 Update fosrestbundle-integration.md
2 parents f5d737e + d391975 commit 9fb2e9f

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

Resources/doc/tutorials/fosrestbundle-integration.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,20 @@ This listener provided by FOSRestBundle determines the best format for the
1313
request based on the HTTP Accept header included in the request and some format
1414
priority configuration.
1515

16-
Since EasyAdmin doesn't define the format of the request, it's recommended to
17-
define this format for all the backend URLs using the FOSRestBundle
18-
configuration.
16+
If you have enabled this format listener, disable it for the backend routes:
1917

20-
Open your main configuration file, look for the `fos_rest` configuration block
21-
and add the following `format_listener` configuration (change the value of
22-
the `path` option if your backend customized the URL prefix):
23-
24-
```yaml
18+
```
2519
# app/config/config.yml
2620
fos_rest:
2721
format_listener:
2822
enabled: true
2923
rules:
30-
- { path: '^/admin', methods: ['GET', 'POST'], priorities: ['html'],
31-
fallback_format: 'html', prefer_extension: false }
24+
# ... previous rules declarations
25+
- { path: '^/admin', stop: true } # <-- add this line
3226
```
3327

28+
When using FOSRestBundle 2.0, you may also need to configure the "zones" as
29+
explained in [this chapter][2] of the FOSRestBundle documentation.
30+
3431
[1]: https://github.com/FriendsOfSymfony/FOSRestBundle
32+
[2]: http://symfony.com/doc/master/bundles/FOSRestBundle/3-listener-support.html

0 commit comments

Comments
 (0)