ekreative / query-parameter-bundle
Installs: 518
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 7
Forks: 0
Open Issues: 1
Type:symfony-bundle
Requires
- php: >=7.1
- sensio/framework-extra-bundle: ^3.0|^4.0|^5.0
- symfony/form: ^3.0|^4.2|^5.0
- symfony/framework-bundle: ^3.0|^4.0|^5.0
- symfony/validator: ^3.0|^4.2|^5.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.16
- phpunit/phpunit: ^9
- symfony/browser-kit: ^3.0|^4.0|^5.0
- symfony/monolog-bundle: ^3.0|^4.0|^5.0
- symfony/yaml: ^3.0|^4.0|^5.0
This package is auto-updated.
Last update: 2024-11-30 00:39:04 UTC
README
The Symfony Bundle for validation request query string parameters in the controllers.
Instaition
composer require ekreative/query-parameter-bundle
Requirements
The Bundle required sensio/framework-extra-bundle
, Symfony components OptionResolver
and PropertyAccess
.
Configuring
app/AppKernel.php
...
public function registerBundles()
{
$bundles = array(
...
new Ekreative\QueryParameterBundle\EkreativeQueryParameterBundle(),
...
);
...
return $bundles;
}
...
Examples
QueryParameter
src/AppBundle/Controller/DefaultController.php
...
/**
* @Route("/")
* @QueryParameter("test", type="boolean", options={"required" = false})
*/
public function indexAction($test)
...
QueryModel
src/AppBundle/Controller/DefaultController.php
...
/**
* @Route("/")
* @QueryModel("testFilter", class="AppBundle\Filter\Filter", options={"required" = false, types={"test" = "boolean"}})
*/
public function indexAction(Filter $testFilter)
...
Variable types
- integer
- datetime
- double
- boolean