ikkez/f3-validation-engine

Custom Filters: $params doesn't work

Closed this issue · 1 comments

Hello,
I try to use the validation engine for my cortex models, because it's very usefull and would make my models much more simple.
Therefore, I added following filter:
$validation->addFilter('optionalInt', function($value, $params = null) {
var_dump($params);
if (is_null($value) || $value === '')
return null;
else if (is_int($value) || (is_string($value) && ctype_digit($value)))
return (int) $value;
return null;
});
The params, I lookt with the var_dump commant to it, allways are null.
Even if I write:
'filter' => 'optionalInt,5'
the $params variable is null.
Do I make a mistake or is this a bug?

ikkez commented

thanks for letting me know. It's fixed in the latest release now.