DoctrineForm.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Bundle\WebConfiguratorBundle\Form;
  11. use Symfony\Bundle\WebConfiguratorBundle\Step\DoctrineStep;
  12. use Symfony\Component\Form\Form;
  13. use Symfony\Component\Form\TextField;
  14. use Symfony\Component\Form\ChoiceField;
  15. use Symfony\Component\Form\PasswordField;
  16. use Symfony\Component\Form\RepeatedField;
  17. use Symfony\Component\Form\HiddenField;
  18. /**
  19. * Doctrine Form.
  20. *
  21. * @author Fabien Potencier <fabien@symfony.com>
  22. */
  23. class DoctrineForm extends Form
  24. {
  25. public function configure()
  26. {
  27. $this->add(new ChoiceField('driver', array('choices' => DoctrineStep::getDrivers())));
  28. $this->add(new TextField('name'));
  29. $this->add(new TextField('host'));
  30. $this->add(new TextField('user'));
  31. $this->add(new RepeatedField(new PasswordField('password', array('required' => false)), array('required' => false, 'first_key' => 'Password', 'second_key' => 'Again')));
  32. }
  33. }