Skip to content

Commit

Permalink
[Form] renamed invalid_message_template to invalid_message to be cons…
Browse files Browse the repository at this point in the history
…istent with other error message names
  • Loading branch information
fabpot committed Jul 18, 2011
1 parent f9229fe commit bb452cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Symfony/Component/Form/Extension/Core/Type/FieldType.php
Expand Up @@ -54,7 +54,7 @@ public function buildForm(FormBuilder $builder, array $options)
->setAttribute('pattern', $options['pattern'])
->setAttribute('label', $options['label'] ?: $this->humanize($builder->getName()))
->setAttribute('attr', $options['attr'] ?: array())
->setAttribute('invalid_message_template', $options['invalid_message_template'])
->setAttribute('invalid_message', $options['invalid_message'])
->setAttribute('invalid_message_parameters', $options['invalid_message_parameters'])
->setData($options['data'])
->addValidator(new DefaultValidator())
Expand Down Expand Up @@ -125,7 +125,7 @@ public function getDefaultOptions(array $options)
'error_mapping' => array(),
'label' => null,
'attr' => array(),
'invalid_message_template' => 'This value is not valid',
'invalid_message' => 'This value is not valid',
'invalid_message_parameters' => array(),
);

Expand Down
Expand Up @@ -21,7 +21,7 @@ public function validate(FormInterface $form)
{
if (!$form->isSynchronized()) {
$form->addError(new FormError(
$form->getAttribute('invalid_message_template'),
$form->getAttribute('invalid_message'),
$form->getAttribute('invalid_message_parameters')
));
}
Expand Down

0 comments on commit bb452cd

Please sign in to comment.