]> git.immae.eu Git - github/wallabag/wallabag.git/blob - vendor/symfony/form/Symfony/Component/Form/Extension/HttpFoundation/Type/FormTypeHttpFoundationExtension.php
twig implementation
[github/wallabag/wallabag.git] / vendor / symfony / form / Symfony / Component / Form / Extension / HttpFoundation / Type / FormTypeHttpFoundationExtension.php
1 <?php
2
3 /*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <fabien@symfony.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12 namespace Symfony\Component\Form\Extension\HttpFoundation\Type;
13
14 use Symfony\Component\Form\AbstractTypeExtension;
15 use Symfony\Component\Form\Extension\HttpFoundation\EventListener\BindRequestListener;
16 use Symfony\Component\Form\Extension\HttpFoundation\HttpFoundationRequestHandler;
17 use Symfony\Component\Form\FormBuilderInterface;
18
19 /**
20 * @author Bernhard Schussek <bschussek@gmail.com>
21 */
22 class FormTypeHttpFoundationExtension extends AbstractTypeExtension
23 {
24 /**
25 * @var BindRequestListener
26 */
27 private $listener;
28
29 /**
30 * @var HttpFoundationRequestHandler
31 */
32 private $requestHandler;
33
34 public function __construct()
35 {
36 $this->listener = new BindRequestListener();
37 $this->requestHandler = new HttpFoundationRequestHandler();
38 }
39
40 /**
41 * {@inheritdoc}
42 */
43 public function buildForm(FormBuilderInterface $builder, array $options)
44 {
45 $builder->addEventSubscriber($this->listener);
46 $builder->setRequestHandler($this->requestHandler);
47 }
48
49 /**
50 * {@inheritdoc}
51 */
52 public function getExtendedType()
53 {
54 return 'form';
55 }
56 }