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
return $this->validator->validate($values,
[
'name' => ['rules' => V::notEmpty(),
'messages' => [
'notEmpty' => 'The name can not be left blank',
]
],
'use_building' => ['rules' => V::optional(V::intVal()->between(1, 8)),
'messages' => [
'intVal' => 'IT is not a valid type of use',
'between' => 'It is not a permitted use',
]
],
'other_use_building' => [ 'rules' => V::key('use_building', V::optional(V::intVal()->between(1, 8)))
->when(V::key('use_building', V::equals(8)),
V::key('other_use_building', V::notEmpty()),
V::key('use_building', V::optional(v::intVal()))
),
'messages' => [
'notEmpty' => 'The Other user buildin can not be left blank',
]
]
]);
tells me what error when he had to see given true
{
"errors": {
"other_use_building": {
"key": "Key use_building must be present"
}
}
}
Thanks for the help
The text was updated successfully, but these errors were encountered:
Hi, first thank for the help.
I have the following data array:
The validation has to check that when use_building is 8 the other_use_building is not empty.
If I perform the validation in a file for tests, the following validation works correctly:
But when I enter it in the slim-validation system
tells me what error when he had to see given true
Thanks for the help
The text was updated successfully, but these errors were encountered: