I am having a common validator like this for adding User and patien detail
# src/Acme/DemoBundle/Resources/config/validator.yml
Acme\DemoBundle\Entity\contact:
properties:
lastName:
- NotBlank:
groups: [adduser, addpatient]
message: Last Name Should not be blank
What i need is to show different validator message for different groups like
for adduser
User Name Should not be blank
And for addpatient
Patient Name Should not be blank
I tried like
Acme\DemoBundle\Entity\contact:
properties:
lastName:
- NotBlank:
groups: adduser
message: User Name Should not be blank
groups: addpatient
message: Patient Name Should not be blank
and also
Acme\DemoBundle\Entity\contact:
properties:
lastName:
- NotBlank:
groups: adduser
message: User Name Should not be blank
lastName:
- NotBlank:
groups: addpatient
message: Patient Name Should not be blank