mirror of
https://github.com/vlucas/valitron.git
synced 2025-12-30 23:01:52 +00:00
Merge pull request #19 from diegosala/master
Fix for _validations not associative
This commit is contained in:
commit
4beb5f6075
@ -530,7 +530,11 @@ class Validator
|
||||
*/
|
||||
protected function hasRule($name, $field)
|
||||
{
|
||||
return isset($this->_validations[$name]) && in_array($field, $this->_validations[$name]['fields']);
|
||||
foreach($this->_validations as $validation) {
|
||||
if ($validation['rule'] == $name)
|
||||
return in_array($field, $validation['fields']);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user