skowronline / query-param-validator-bundle
Validate Query Param values
Installs: 22
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 0
Type:symfony-bundle
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: 2024-10-30 19:35:23 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()