Remove validation_groups
This commit is contained in:
@@ -58,13 +58,13 @@ class CustomerLogin extends BaseForm
|
||||
)
|
||||
))
|
||||
->add("account", "choice", array(
|
||||
/*"constraints" => array(
|
||||
"constraints" => array(
|
||||
new Constraints\Callback(array(
|
||||
"methods" => array(
|
||||
array($this, "verifyAccount")
|
||||
)
|
||||
))
|
||||
),*/
|
||||
),
|
||||
"choices" => array(
|
||||
0 => Translator::getInstance()->trans("No, I am a new customer."),
|
||||
1 => Translator::getInstance()->trans("Yes, I have a password :")
|
||||
@@ -72,14 +72,7 @@ class CustomerLogin extends BaseForm
|
||||
"label_attr" => array(
|
||||
"for" => "account"
|
||||
),
|
||||
"data" => 0,
|
||||
'validation_groups' => function(FormInterface $form) {
|
||||
$account = $form->getData();
|
||||
if ($account === 1)
|
||||
return 'existing_customer';
|
||||
else
|
||||
return 'Default';
|
||||
}
|
||||
"data" => 0
|
||||
))
|
||||
->add("password", "password", array(
|
||||
"constraints" => array(
|
||||
@@ -131,26 +124,6 @@ class CustomerLogin extends BaseForm
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setDefaultOptions(OptionsResolverInterface $resolver)
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
//'cascade_validation' => true,
|
||||
// 'csrf_protection' => true,
|
||||
//'csrf_field_name' => '_token',
|
||||
'validation_groups' => function(FormInterface $form) {
|
||||
$data = $form->getData();
|
||||
if ($data->getAccount() == 1)
|
||||
return array('Default', 'existing_customer');
|
||||
else
|
||||
return 'Default';
|
||||
}
|
||||
));
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return "thelia_customer_login";
|
||||
|
||||
Reference in New Issue
Block a user