phpMv
-UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
Loading...
Searching...
No Matches
AjaxRule.php
Go to the documentation of this file.
1
<?php
2
namespace
Ajax\semantic\components\validation
;
3
4
use
Ajax\JsUtils
;
5
use
Ajax\service\AjaxCall
;
6
15
class
AjaxRule
extends
CustomRule
{
16
17
private
$ajaxCall
;
18
19
public
function
__construct
(
$type
, $url, $params, $jsCallback =
null
, $method =
'post'
, $parameters = [],
$prompt
= NULL,
$value
= NULL) {
20
parent::__construct(
$type
,
$prompt
,
$value
);
21
$parameters = \array_merge([
22
'async'
=>
false
,
23
'url'
=> $url,
24
'params'
=> $params,
25
'hasLoader'
=>
false
,
26
'jsCallback'
=> $jsCallback,
27
'dataType'
=>
'json'
,
28
'stopPropagation'
=>
false
,
29
'preventDefault'
=>
false
,
30
'responseElement'
=>
null
31
], $parameters);
32
$this->ajaxCall =
new
AjaxCall
($method, $parameters);
33
}
34
35
public
function
compile
(
JsUtils
$js) {
36
$js->
exec
(
Rule::custom
($this->
getType
(),
"function(value,ruleValue){var result=true;"
. $this->ajaxCall->compile($js) .
"return result;}"
),
true
);
37
}
38
}
Ajax\JsUtils
JQuery PHP library.
Definition
JsUtils.php:23
Ajax\common\traits\JsUtilsActionsTrait\exec
exec($js, $immediatly=false)
Executes the code $js.
Definition
JsUtilsActionsTrait.php:593
Ajax\semantic\components\validation\AjaxRule
Ajax\semantic\components\validation$AjaxRule This class is part of phpmv-ui.
Definition
AjaxRule.php:15
Ajax\semantic\components\validation\AjaxRule\compile
compile(JsUtils $js)
Definition
AjaxRule.php:35
Ajax\semantic\components\validation\AjaxRule\__construct
__construct($type, $url, $params, $jsCallback=null, $method='post', $parameters=[], $prompt=NULL, $value=NULL)
Definition
AjaxRule.php:19
Ajax\semantic\components\validation\AjaxRule\$ajaxCall
$ajaxCall
Definition
AjaxRule.php:17
Ajax\semantic\components\validation\CustomRule
Ajax\semantic\components\validation$CustomRule This class is part of phpmv-ui.
Definition
CustomRule.php:14
Ajax\semantic\components\validation\Rule\$value
$value
Definition
Rule.php:24
Ajax\semantic\components\validation\Rule\custom
static custom($name, $jsFunction)
Definition
Rule.php:166
Ajax\semantic\components\validation\Rule\getType
getType()
Definition
Rule.php:32
Ajax\semantic\components\validation\Rule\$prompt
$prompt
Definition
Rule.php:19
Ajax\semantic\components\validation\Rule\$type
$type
Definition
Rule.php:15
Ajax\service\AjaxCall
Definition
AjaxCall.php:6
Ajax\semantic\components\validation
Definition
AjaxRule.php:2
Ajax
semantic
components
validation
AjaxRule.php
Generated on Sun Dec 10 2023 16:16:01 for
phpMv-UI
by
doxygen
1.9.8