WARNING:

You are browsing the documentation for version 2.7 which is not maintained anymore.

If some of your projects are still using this version, consider upgrading.

Full default annotations

2.7 version
Maintained Unmaintained
2.7

Full default annotations

Param fetcher

QueryParam

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
use FOS\RestBundle\Controller\Annotations\QueryParam;

/**
 * @QueryParam(
 *   name="",
 *   key=null,
 *   requirements="",
 *   incompatibles={},
 *   default=null,
 *   description="",
 *   strict=false,
 *   map=false,
 *   nullable=false
 * )
 */

RequestParam

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
use FOS\RestBundle\Controller\Annotations\RequestParam;

/**
 * @RequestParam(
 *   name="",
 *   key=null,
 *   requirements="",
 *   default=null,
 *   description="",
 *   strict=true,
 *   map=false,
 *   nullable=false
 * )
 */

FileParam

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
use FOS\RestBundle\Controller\Annotations\FileParam;

/**
 * @FileParam(
 *   name="",
 *   key=null,
 *   requirements={},
 *   default=null,
 *   description="",
 *   strict=true,
 *   nullable=false,
 *   image=false
 * )
 */

View

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
use FOS\RestBundle\Controller\Annotations\View;

/**
 * @View(
 *  templateVar="",
 *  statusCode=null,
 *  serializerGroups={},
 *  populateDefaultVars=true,
 *  serializerEnableMaxDepthChecks=false
 * )
 */

Routing

Route prefix

1
2
3
4
5
use FOS\RestBundle\Controller\Annotations\Prefix;

/**
 * @Prefix("")
 */

Route name prefix

1
2
3
4
5
use FOS\RestBundle\Controller\Annotations\NamePrefix;

/**
 * @NamePrefix("")
 */

Route

RestBundle extends the @Route Symfony annotation from Symfony.

@Delete @Get @Head @Link @Patch @Post @Put @Unlink @Lock @Unlock @PropFind @PropPatch @Move @Mkcol @Copy are shortcuts to define routes limited to a specific HTTP method. They have the same options as @Route.

This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.