skowronline/query-param-validator-bundle

Validate Query Param values

Installs: 24

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 0

Open Issues: 0

Type:symfony-bundle

pkg:composer/skowronline/query-param-validator-bundle

v1.0.0 2017-01-05 08:54 UTC

This package is not auto-updated.

Last update: 2025-10-02 00:16:40 UTC


README

Bundle helps you validate request query string values

Build Status codecov.io SensioLabsInsight

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()