Skip to content
This repository
Browse code

Update Resources/doc/5-automatic-route-generation_single-restful-cont…

…roller.md
  • Loading branch information...
commit 2d1b3b160756a1d40b5e38fdba85a8f721ec28fb 1 parent 8c1540d
Luis Cordova cordoval authored
13 Resources/doc/5-automatic-route-generation_single-restful-controller.md
Source Rendered
@@ -22,6 +22,11 @@ https://github.com/liip/LiipHelloBundle/blob/master/Controller/RestController.ph
22 22 Single RESTful controller routes
23 23 ================================
24 24
  25 +Single as opposed to multiple is just the focus of our routes, that is whether they are referring
  26 +to just one resource without subresources or to resources that have subresources. The resource
  27 +routes in the second case is described a bit different and is seen in the next section. Now we
  28 +turn to simple resource routes.
  29 +
25 30 ```yaml
26 31 # app/config/routing.yml
27 32 users:
@@ -31,9 +36,11 @@ users:
31 36
32 37 This will tell Symfony2 to automatically generate proper REST routes from your ``UsersController`` action names.
33 38 Notice ``type: rest`` option. It's required so that the RestBundle can find which routes are supported.
34   -Notice ``name_prefix: <my_bundle_>`` option. It's useful to prefix the generated controller routes to organize
35   -your several resources paths. Take care that you can use ``name_prefix`` on an import only when the file is
36   -imported itself with the type ``rest``. You can also set a parent and a regular prefix as well as any other route.
  39 +
  40 +Notice the ``name_prefix: my_bundle_`` option. It's useful to prefix the generated controller routes to organize
  41 +your several resources paths. Take care that you can use ``name_prefix`` on an import only when the file is imported
  42 +itself with the type ``rest``. The parent option is used in subresources as we will see in the next section for
  43 +multiple RESTful controller routes.
37 44
38 45 ## Define resource actions
39 46

0 comments on commit 2d1b3b1

Please sign in to comment.
Something went wrong with that request. Please try again.