You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This can easily become Wiki material but right now it's a call for help. I added new fields to ZfcUser. One of them is sex. My problem here is with the validation messages. They work just fine but while editing users, manipulating the form's value (I changed it to "s") I got these messages:
The input was not found in the haystack
The input does not match against pattern '/^(m|f)$/'
An invalid sex type was entered
Obviously, I only want to display the third message whenever the input data doesn't match my criteria. Anything else is not user-friendly. Zend's Validation Messages[1] page demonstrates how you can override messages but it doesn't say how you can restrict certain messages or only display what you want. I looked for solutions on the web and I also went to the ZF irc channel, but I didn't find what I needed. How can we output only our validation messages?
or a better way would be to extend the validator classes override the default message templates. Once the overriding is completed, it will just need to be invoked either in your Module.php or module.config.php
This can easily become Wiki material but right now it's a call for help. I added new fields to ZfcUser. One of them is sex. My problem here is with the validation messages. They work just fine but while editing users, manipulating the form's value (I changed it to "s") I got these messages:
Obviously, I only want to display the third message whenever the input data doesn't match my criteria. Anything else is not user-friendly. Zend's Validation Messages[1] page demonstrates how you can override messages but it doesn't say how you can restrict certain messages or only display what you want. I looked for solutions on the web and I also went to the ZF irc channel, but I didn't find what I needed. How can we output only our validation messages?
[1] http://framework.zend.com/manual/2.0/en/modules/zend.validator.messages.html
Here are the details of my custom field:
module\ZfcUser\src\ZfcUser\Form\Base.php -> __construct:
module\ZfcUser\src\ZfcUser\Form\RegisterFilter.php -> __construct:
module\ZfcUserAdmin\config\services.config.php ->
$filter = new $registerFilter(
module\ZfcUserAdmin\src\ZfcUserAdmin\Validator\SexEdit.php
The text was updated successfully, but these errors were encountered: