Skip to content

Commit

Permalink
minor #1085 Updated the tutorial about FOSRestBundle integration (Yun…
Browse files Browse the repository at this point in the history
…yun548, javiereguiluz)

This PR was merged into the master branch.

Discussion
----------

Updated the tutorial about FOSRestBundle integration

This finishes #1083 with the comments provided by @ogizanagi and @xabbuh.

Commits
-------

d391975 Reworded the article
a4d5b45 Update fosrestbundle-integration.md
  • Loading branch information
javiereguiluz committed Apr 15, 2016
2 parents f5d737e + d391975 commit 9fb2e9f
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions Resources/doc/tutorials/fosrestbundle-integration.md
Expand Up @@ -13,22 +13,20 @@ This listener provided by FOSRestBundle determines the best format for the
request based on the HTTP Accept header included in the request and some format
priority configuration.

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

Open your main configuration file, look for the `fos_rest` configuration block
and add the following `format_listener` configuration (change the value of
the `path` option if your backend customized the URL prefix):

```yaml
```
# app/config/config.yml
fos_rest:
format_listener:
enabled: true
rules:
- { path: '^/admin', methods: ['GET', 'POST'], priorities: ['html'],
fallback_format: 'html', prefer_extension: false }
# ... previous rules declarations
- { path: '^/admin', stop: true } # <-- add this line
```

When using FOSRestBundle 2.0, you may also need to configure the "zones" as
explained in [this chapter][2] of the FOSRestBundle documentation.

[1]: https://github.com/FriendsOfSymfony/FOSRestBundle
[2]: http://symfony.com/doc/master/bundles/FOSRestBundle/3-listener-support.html

0 comments on commit 9fb2e9f

Please sign in to comment.