made HttpFoundationRequestHandler a service
This commit is contained in:
parent
feea36df99
commit
43451e9f50
@ -10,6 +10,7 @@
|
||||
<parameter key="form.factory.class">Symfony\Component\Form\FormFactory</parameter>
|
||||
<parameter key="form.extension.class">Symfony\Component\Form\Extension\DependencyInjection\DependencyInjectionExtension</parameter>
|
||||
<parameter key="form.type_guesser.validator.class">Symfony\Component\Form\Extension\Validator\ValidatorTypeGuesser</parameter>
|
||||
<parameter key="form.type_extension.form.request_handler.class">Symfony\Component\Form\Extension\HttpFoundation\HttpFoundationRequestHandler</parameter>
|
||||
</parameters>
|
||||
|
||||
<services>
|
||||
@ -148,9 +149,13 @@
|
||||
|
||||
<!-- FormTypeHttpFoundationExtension -->
|
||||
<service id="form.type_extension.form.http_foundation" class="Symfony\Component\Form\Extension\HttpFoundation\Type\FormTypeHttpFoundationExtension">
|
||||
<argument type="service" id="form.type_extension.form.request_handler" />
|
||||
<tag name="form.type_extension" alias="form" />
|
||||
</service>
|
||||
|
||||
<!-- HttpFoundationRequestHandler -->
|
||||
<service id="form.type_extension.form.request_handler" class="%form.type_extension.form.request_handler.class%" public="false" />
|
||||
|
||||
<!-- FormTypeValidatorExtension -->
|
||||
<service id="form.type_extension.form.validator" class="Symfony\Component\Form\Extension\Validator\Type\FormTypeValidatorExtension">
|
||||
<tag name="form.type_extension" alias="form" />
|
||||
|
@ -13,8 +13,9 @@ namespace Symfony\Component\Form\Extension\HttpFoundation\Type;
|
||||
|
||||
use Symfony\Component\Form\AbstractTypeExtension;
|
||||
use Symfony\Component\Form\Extension\HttpFoundation\EventListener\BindRequestListener;
|
||||
use Symfony\Component\Form\Extension\HttpFoundation\HttpFoundationRequestHandler;
|
||||
use Symfony\Component\Form\RequestHandlerInterface;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Form\Extension\HttpFoundation\HttpFoundationRequestHandler;
|
||||
|
||||
/**
|
||||
* @author Bernhard Schussek <bschussek@gmail.com>
|
||||
@ -27,14 +28,17 @@ class FormTypeHttpFoundationExtension extends AbstractTypeExtension
|
||||
private $listener;
|
||||
|
||||
/**
|
||||
* @var HttpFoundationRequestHandler
|
||||
* @var RequestHandlerInterface
|
||||
*/
|
||||
private $requestHandler;
|
||||
|
||||
public function __construct()
|
||||
/**
|
||||
* @param RequestHandlerInterface $requestHandler
|
||||
*/
|
||||
public function __construct(RequestHandlerInterface $requestHandler = null)
|
||||
{
|
||||
$this->listener = new BindRequestListener();
|
||||
$this->requestHandler = new HttpFoundationRequestHandler();
|
||||
$this->requestHandler = $requestHandler ?: new HttpFoundationRequestHandler();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user