skowronline / query-param-validator-bundle
Validate Query Param values
Package info
github.com/skowron-line/QueryParamValidatorBundle
Type:symfony-bundle
pkg:composer/skowronline/query-param-validator-bundle
v1.0.0
2017-01-05 08:54 UTC
Requires
- php: ^5.5.9|^7.0.0
- symfony/http-foundation: ^2.7 || ^3.0
- symfony/options-resolver: ^2.7 || ^3.0
Requires (Dev)
- phpunit/phpunit: ^5.3
This package is not auto-updated.
Last update: 2026-03-19 02:44:32 UTC
README
Bundle helps you validate request query string values
Installation
composer require skowronline/query-param-validator-bundle
// app/config.yml imports: ... - { resource: '@SkowronlineQueryParamValidatorBundle/Resources/config/services.yml' }
Usage
/** * @QueryParam("order", allowed={"asc", "desc"}, required=true) */ public function indexAction()
/route -> 404 Page Not Found
/route?order=asc -> 200 Ok
/route?order=desc -> 200 Ok
/route?order=random -> 404 Page Not Found
You can use multiple annotations
/** * @QueryParam("order", allowed={"asc", "desc"}, required=true) * @QueryParam("page", required=false) */ public function indexAction()