Closure.php
Go to the documentation of this file.
1<?php
7
11class Closure extends Validator
12{
17
25 public function validate($value, $parameters = array())
26 {
27 return call_user_func($this->validatorFunction, $value, $parameters);
28 }
29
36 public function setFunc($validatorFunction)
37 {
38 $this->validatorFunction = $validatorFunction;
39 }
40}
customizable validator for input elements
Definition Closure.php:12
$validatorFunction
function to call
Definition Closure.php:16
setFunc($validatorFunction)
sets the validators validator function
Definition Closure.php:36
validate($value, $parameters=array())
validates value with a callable function/closure
Definition Closure.php:25
Validators for HTML input-elements.