php - Symfony2 getter validation -
i need validate datetime
values booking system hostels , hotels. that, need getter validation. implemented isarrivaldatevalid()
method return false (for testing purposes).
when try run method in twig form_errors(form.arrivaldatevalid), keep getting arrivaldatevalid
not exist although symfony knows method.
the same problem here
but solved error_bubbling
mine isn't, no matter if error_bubbling
true or false; have feeling basic problem last hour, cannot solve no matter do.
any appreciated.
edit:
here validation.yml...
hotel\rezervacijabundle\entity\rezervacija: properties: ime : - notblank : { message : "ime je obavezno" } prezime : - notblank: { message: "prezime je obavezno" } email : - notblank : { message: "e-mail je obavezan" } - email : { message: "e-mail mora biti ispravan" } getters: arrivaldatevalid : - "false" : { message "vrijeme dolaska ne može biti u prošlosti" }
when using yaml, sure surround true quotes ('true') or else yaml convert true boolean value.
please check out @ http://symfony.com/doc/current/reference/constraints/true.html
and can check reference show getters messages http://symfony.com/doc/current/reference/forms/types/entity.html#error-bubbling , http://symfony.com/doc/current/reference/forms/types/entity.html#error-mapping
Comments
Post a Comment