dev-master
9999999-dev
MIT
The Requires
The Development Requires
enum paramconverter myclabs
Wallogit.com
2017 © Pedro Peláez
A simple Symfony bundle to enable seamless MyClabs\Enum param conversion in your controllers., (*1)
composer require ex3v/myclabs-enum-param-converter
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new \Ex3v\MyCLabsEnumParamConverterBundle\MyCLabsEnumParamConverterBundle(),
);
}
/**
* @ParamConverter("barType")
*/
public function fooAction(BarType $barType) : Response
{
//...
}
Note that you do not have to point out specific converter as long as you use typehints in your controller actions., (*3)
If you want to point out this converter explicitly, use following example:, (*4)
/**
* @ParamConverter("barType", converter="converter_enum")
*/
public function fooAction(BarType $barType) : Response
{
//...
}
MIT
enum paramconverter myclabs