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