complete login form
This commit is contained in:
@@ -102,6 +102,10 @@ abstract class BaseForm
|
||||
$this->formBuilder->add("success_url", "text");
|
||||
}
|
||||
|
||||
if (! $this->formBuilder->has('error_message')) {
|
||||
$this->formBuilder->add("error_message", "text");
|
||||
}
|
||||
|
||||
$this->form = $this->formBuilder->getForm();
|
||||
}
|
||||
|
||||
|
||||
@@ -22,24 +22,38 @@
|
||||
/*************************************************************************************/
|
||||
namespace Thelia\Form;
|
||||
|
||||
use Symfony\Component\Validator\Constraints\Callback;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
use Symfony\Component\Validator\Constraints\Email;
|
||||
use Symfony\Component\Validator\ExecutionContextInterface;
|
||||
use Thelia\Core\Translation\Translator;
|
||||
use Thelia\Model\CustomerQuery;
|
||||
|
||||
class CustomerLogin extends BaseForm
|
||||
{
|
||||
protected function buildForm()
|
||||
{
|
||||
$this->formBuilder
|
||||
->add("email", "text", array(
|
||||
->add("email", "email", array(
|
||||
"constraints" => array(
|
||||
new NotBlank(),
|
||||
new Email()
|
||||
)
|
||||
),
|
||||
"label" => Translator::getInstance()->trans("Please enter your email address"),
|
||||
"label_attr" => array(
|
||||
"for" => "email"
|
||||
),
|
||||
"required" => true
|
||||
))
|
||||
->add("password", "password", array(
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
)
|
||||
),
|
||||
"label" => Translator::getInstance()->trans("Please enter your password"),
|
||||
"label_attr" => array(
|
||||
"for" => "password"
|
||||
),
|
||||
"required" => true
|
||||
))
|
||||
->add("remember_me", "checkbox")
|
||||
;
|
||||
@@ -49,4 +63,5 @@ class CustomerLogin extends BaseForm
|
||||
{
|
||||
return "thelia_customer_login";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user