-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using messages from ZF validators + fix buildInlineJavascript for arrays, functions + added (commented for now additional-methods JS) #50
base: master
Are you sure you want to change the base?
Conversation
…es for value_options
@@ -30,8 +30,7 @@ public function getRules(ValidatorInterface $validator, ElementInterface $elemen | |||
public function getMessages(ValidatorInterface $validator) | |||
{ | |||
return [ | |||
'range' => | |||
sprintf($this->translateMessage('The input is not between %s and %s'), $this->getMin($validator), $this->getMax($validator)) | |||
'range' => sprintf($validator->getMessageTemplates()[\Zend\Validator\Between::NOT_BETWEEN], $this->getMin($validator), $this->getMax($validator)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This message need to be passed through the translator. You can use the same method as before $this->translateMessage()
@@ -86,6 +86,7 @@ public function preRenderForm($formAlias, View $view, FormInterface $form = null | |||
if ($options->getIncludeAssets()) { | |||
$assetBaseUri = $this->getHttpRouter()->assemble([], ['name' => 'strokerform-asset']); | |||
$inlineScript->appendFile($assetBaseUri . '/jquery_validate/js/jquery.validate.js'); | |||
//$inlineScript->appendFile($assetBaseUri . '/jquery_validate/js/additional-methods.min.js'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please include the asset and don't remove this line
$value = (is_string($value)) ? $value : var_export($value, true); | ||
|
||
if(is_string($value)){ | ||
if(strpos($value, 'function') === 0){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a unit test for this case please? Than we can also see if we can improve this code a little because it is a littlebit messy now with all these if / else statements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not very familiar with unit tests unfortunatelly.
No description provided.