jBBCode
jBBCode copied to clipboard
Allow function as parameter of setOptionValidator() & setBodyValidator()
I need a number validator(for a [size] tag).
I would be very nice to be able to do a simple setOptionValidator('is_numeric');
rather than having to wrap is_numeric() inside a class just to use it in this context
class sizeValidator implements \JBBCode\InputValidator
{
public function validate($input)
{
return is_numeric($input)
}
}
setOptionValidator(new sizeValidator());
Would also allow for anonymous function as argument
setOptionValidator(function($input) { return is_numeric($input) });
-Assigned:
+Assigned: Kubo2
just to not forget about this one
Hey @jbowens, could you please really assign me to this one? I already have an implementation here: #61
@cstdenis You can use my implementation in #61. I don't think it will get into the jBBCode's codebase that fast.