|
| 1 | +Manual definition of routes |
| 2 | +===================================== |
| 3 | + |
| 4 | +If the automatic route generation does not fit your needs, you can manually define a route using simple annotations. This is very helpful if you want to have more than 1 url parameter without having a static word in between them. |
| 5 | + |
| 6 | +For a full list of annotations check out FOS/RestBundle/Controller/Annotations |
| 7 | + |
| 8 | +## Delete Route Definition |
| 9 | + use FOS\RestBundle\Controller\Annotations\Delete; |
| 10 | + |
| 11 | + /** |
| 12 | + * DELETE Route annotation. |
| 13 | + * @Delete("/likes/{type}/{typeId}") |
| 14 | + */ |
| 15 | + |
| 16 | +## Head Route Definition |
| 17 | + use FOS\RestBundle\Controller\Annotations\Head; |
| 18 | + |
| 19 | + /** |
| 20 | + * HEAD Route annotation. |
| 21 | + * @Head("/likes/{type}/{typeId}") |
| 22 | + */ |
| 23 | + |
| 24 | +## Get Route Definition |
| 25 | + use FOS\RestBundle\Controller\Annotations\Get; |
| 26 | + |
| 27 | + /** |
| 28 | + * GET Route annotation. |
| 29 | + * @Get("/likes/{type}/{typeId}") |
| 30 | + */ |
| 31 | + |
| 32 | +## Patch Route Definition |
| 33 | + use FOS\RestBundle\Controller\Annotations\Patch; |
| 34 | + |
| 35 | + /** |
| 36 | + * PATCH Route annotation. |
| 37 | + * @Patch("/likes/{type}/{typeId}") |
| 38 | + */ |
| 39 | + |
| 40 | +## Post Route Definition |
| 41 | + use FOS\RestBundle\Controller\Annotations\Post; |
| 42 | + |
| 43 | + /** |
| 44 | + * POST Route annotation. |
| 45 | + * @Post("/likes/{type}/{typeId}") |
| 46 | + */ |
| 47 | + |
| 48 | +## Put Route Definition |
| 49 | + use FOS\RestBundle\Controller\Annotations\Put; |
| 50 | + |
| 51 | + /** |
| 52 | + * PUT Route annotation. |
| 53 | + * @Put("/likes/{type}/{typeId}") |
| 54 | + */ |
| 55 | + |
| 56 | + |
0 commit comments