reimplement form already created
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user