1
vote
1answer
13 views

Symfony2 : Recursive Validation

I've got an entity with some validators (not a form). So I use $validator->validate($entity), but it doesn't validate my sub-ojects (the entity class has some others entity classes with some ...
0
votes
2answers
69 views

symfony2 - how to make validation focus bubble with custom rules

I am looking to create some client side javascript validation. I am wondering how to re-use the one Symfony already has in place (see screenshot) it looks kind of like a tooltip and I think it ...
0
votes
0answers
9 views

In Symfony2 + Doctrine can mapping (orm) and validation YML files be combined?

It's not vital by any means, but it would be nice to be able to combine the mapping definition (.../Resources/config/doctrine/Foo.orm.yml) and the validation rules ...
8
votes
5answers
2k views

In Symfony2, can the validation.yml file be split into multiple files using imports?

Right now, I have a file called validation.yml with the validation of all the bundle's entities in one file. validation.yml Blogger\BlogBundle\Entity\Comment properties: username: ...
0
votes
3answers
49 views

Symfony2 repeated type does not validate

I have two password fields. That extra is for confirmation. And there is no error message when both are empty or when passwords don't match. How to enable or debug this validation which I presume ...
0
votes
0answers
30 views

Symfony Doctrine One to Many Validation

I'm wanting to validate all the images that are linked to the entity by one to many relationship with the KitchenImage table. Here's my controller function: public function addAction(Request ...
0
votes
1answer
29 views

Symfony2 validation messages translation. Fallback option does not works

I have SF2.3 at my webserver. I am using validatorBuilder to validate my data. Here is my config: framework: translator: { fallback: ru } default_locale: ru Here is my event ...
0
votes
1answer
21 views

Symfony2: Unable to overwrite 'maxSize' and 'maxSizeMessage' in Image/File constraint

I use this code in my entity class: /** * @Assert\File(maxSize="8388608", maxSizeMessage="8 MB please") */ protected $imageFile; or this one: /** * @Assert\Image(maxSize="8M", maxSizeMessage="8 MB ...
0
votes
0answers
57 views

Symfony2 DataTransformer allow NULL

My data transformer: /** * Transform * * @param \Bundle\LocationBundle\Entity\Location $location Location * * @return array */ public function transform($location) { if (empty($location)) { ...
0
votes
2answers
39 views

Symfony2 - How to validate an email address in a controller

There is an email validator in symfony that can be used in a form: http://symfony.com/doc/current/reference/constraints/Email.html My question is: How can I use this validator in my controlelr in ...
1
vote
1answer
34 views

symfony form validation message for hidden field not shown

My problem is pretty simple, but i really don't know what to do to solve it. Here the situation : In symfony2 (2.3.*) i've created a form (DocumentType.php + twig render template). A file form is ...
0
votes
1answer
24 views

Can I change a value from within a Constraint or ConstraintValidator?

I'm using the Form component in my own stack, and I need to create a constraint/validator pair. The problem is that I need to modify the value inside the constraint. Eg: if the value is 123, change ...
3
votes
3answers
441 views

Validating dynamically loaded choices in Symfony 2

I have a choice field type named *sub_choice* in my form whose choices will be dynamically loaded through AJAX depending on the selected value of the parent choice field, named *parent_choice*. ...
0
votes
2answers
49 views

Symfony2 - Dynamic form choices - validation remove

I have a drop down form element. Initially it starts out empty but it is populated with values via javascript after the user has made some interactions. Thats all working ok. However when I submit ...
2
votes
2answers
990 views

Validate a property dependent on another property symfony 2

is it possible to validate a property of a model class dependent on another porperty of the same class? (sorry, if it's confusing my english is not that well.) So for example: I have a class: class ...

1 2 3 4 5 19
15 30 50 per page