11class Rule implements \JsonSerializable{
59 #[\ReturnTypeWillChange]
62 if(isset($this->prompt))
64 if(isset($this->value))
97 if(\is_int($min) && \is_int($max))
166 public static function custom($name,$jsFunction){
167 return "$.fn.form.settings.rules.".$name.
" =".$jsFunction ;
170 public static function ajax(
JsUtils $js,$name,$url,$params,$jsCallback,$method=
"post",$parameters=[]){
171 $parameters=\array_merge([
"async"=>
false,
"url"=>$url,
"params"=>$params,
"hasLoader"=>
false,
"jsCallback"=>$jsCallback,
"dataType"=>
"json",
"stopPropagation"=>
false,
"preventDefault"=>
false,
"responseElement"=>
null],$parameters);
172 $ajax=
new AjaxCall($method, $parameters);
173 return self::custom($name,
"function(value,ruleValue){var result=true;".$ajax->compile($js).
"return result;}");
static ajax(JsUtils $js, $name, $url, $params, $jsCallback, $method="post", $parameters=[])
static match($name, $prompt=NULL)
A field should match the value of another validation field, for example to confirm passwords.
static isExactly($value, $prompt=NULL)
__construct($type, $prompt=NULL, $value=NULL)
static custom($name, $jsFunction)
static decimal($prompt=NULL)
static doesntContain($value, $prompt=NULL)
static minCount($value, $prompt=NULL)
static integer($min=NULL, $max=NULL, $prompt=NULL)
A field is an integer value, or matches an integer range.
static number($prompt=NULL)
static regExp($value, $prompt=NULL)
static notExactly($value, $prompt=NULL)
static different($name, $prompt=NULL)
A field should be different than another specified field.
static containsExactly($value, $prompt=NULL)
static contains($value, $prompt=NULL)
static maxCount($value, $prompt=NULL)
static is($value, $prompt=NULL)
static exactCount($value, $prompt=NULL)
static doesntContainExactly($value, $prompt=NULL)
static email($prompt=NULL)
static not($value, $prompt=NULL)