reimplement form already created

This commit is contained in:
Manuel Raynaud
2013-06-28 11:45:54 +02:00
parent 995e1eb679
commit 6809c5ba1c
2 changed files with 5 additions and 17 deletions

View File

@@ -50,11 +50,9 @@ class AdminController extends BaseAdminController {
protected function getLoginForm()
{
$form = $this->getFormBuilder();
$adminLogin = new AdminLogin($this->getRequest());
$adminLogin = new AdminLogin();
return $adminLogin->buildForm($form, array())->getForm();
return $adminLogin->getForm();
}
public function lostAction()

View File

@@ -23,16 +23,15 @@
namespace Thelia\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Validator\Constraints\Length;
use Symfony\Component\Validator\Constraints\NotBlank;
class AdminLogin extends AbstractType {
class AdminLogin extends BaseForm {
public function buildForm(FormBuilderInterface $builder, array $options)
protected function buildForm()
{
return $builder
$this->form
->add("username", "text", array(
"constraints" => array(
new NotBlank(),
@@ -42,13 +41,4 @@ class AdminLogin extends AbstractType {
->add("password", "password");
}
/**
* Returns the name of this type.
*
* @return string The name of this type
*/
public function getName()
{
return "admin_login";
}
}