phpMv
-UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
Loading...
Searching...
No Matches
Form.php
Go to the documentation of this file.
1
<?php
2
namespace
Ajax\semantic\components
;
3
4
use
Ajax\JsUtils
;
5
use
Ajax\semantic\components\validation\FieldValidation
;
6
use
Ajax\semantic\components\validation\Rule
;
12
class
Form
extends
SimpleSemExtComponent
{
13
17
public
function
__construct
(
JsUtils
$js
=
null
) {
18
parent::__construct(
$js
);
19
$this->uiName=
"form"
;
20
$this->params[
"fields"
]=[];
21
}
22
23
public
function
addField
($identifier){
24
$this->params[
"fields"
][$identifier]=
new
FieldValidation
($identifier);
25
}
26
27
public
function
setInline
($value){
28
return
$this->
setParam
(
"inline"
,
true
);
29
}
30
31
public
function
setOn
($value){
32
return
$this->
setParam
(
"on"
, $value);
33
}
34
35
36
43
public
function
addFieldRule
($identifier,$type,$prompt=NULL,$value=NULL){
44
if
(isset($this->params[
"fields"
][$identifier])===
false
){
45
$this->
addField
($identifier);
46
}
47
$this->params[
"fields"
][$identifier]->addRule($type,$prompt,$value);
48
}
49
53
public
function
addFieldValidation
($fieldValidation){
54
$this->params[
"fields"
][$fieldValidation->getIdentifier()]=$fieldValidation;
55
}
56
57
public
function
setJs
(
JsUtils
$js
){
58
$this->js=
$js
;
59
}
60
61
public
function
getScript
() {
62
$allParams=
$this->params
;
63
$this->jquery_code_for_compile=array ();
64
$this->jquery_code_for_compile []=
"$( \""
.$this->attachTo.
"\" ).{$this->uiName}("
.$this->
getParamsAsJSON
($allParams).
");"
;
65
$this->
compileEvents
();
66
return
$this->
compileJQueryCode
();
67
}
68
69
public
function
onValid
($jsCode){
70
$this->
addComponentEvent
(
"onValid"
, $jsCode);
71
}
72
}
Ajax\JsUtils
JQuery PHP library.
Definition
JsUtils.php:23
Ajax\common\components\BaseComponent\$js
$js
Definition
BaseComponent.php:20
Ajax\common\components\BaseComponent\setParam
setParam($key, $value)
Definition
BaseComponent.php:35
Ajax\common\components\BaseComponent\getParamsAsJSON
getParamsAsJSON($params)
Definition
BaseComponent.php:26
Ajax\common\components\BaseComponent\$params
$params
Definition
BaseComponent.php:14
Ajax\common\components\SimpleComponent\compileEvents
compileEvents()
Definition
SimpleComponent.php:24
Ajax\common\components\SimpleComponent\compileJQueryCode
compileJQueryCode()
Definition
SimpleComponent.php:46
Ajax\semantic\components\Form
Definition
Form.php:12
Ajax\semantic\components\Form\addField
addField($identifier)
Definition
Form.php:23
Ajax\semantic\components\Form\setOn
setOn($value)
Definition
Form.php:31
Ajax\semantic\components\Form\addFieldRule
addFieldRule($identifier, $type, $prompt=NULL, $value=NULL)
Definition
Form.php:43
Ajax\semantic\components\Form\onValid
onValid($jsCode)
Definition
Form.php:69
Ajax\semantic\components\Form\addFieldValidation
addFieldValidation($fieldValidation)
Definition
Form.php:53
Ajax\semantic\components\Form\setInline
setInline($value)
Definition
Form.php:27
Ajax\semantic\components\Form\getScript
getScript()
Definition
Form.php:61
Ajax\semantic\components\Form\setJs
setJs(JsUtils $js)
Definition
Form.php:57
Ajax\semantic\components\Form\__construct
__construct(JsUtils $js=null)
Definition
Form.php:17
Ajax\semantic\components\SimpleSemExtComponent
Definition
SimpleSemExtComponent.php:8
Ajax\semantic\components\SimpleSemExtComponent\addComponentEvent
addComponentEvent($event, $jsCode)
Definition
SimpleSemExtComponent.php:46
Ajax\semantic\components\validation\FieldValidation
Definition
FieldValidation.php:13
Ajax\semantic\components\validation\Rule
Definition
Rule.php:11
Ajax\semantic\components
Definition
Accordion.php:3
Ajax
semantic
components
Form.php
Generated on Sun Dec 10 2023 16:15:59 for
phpMv-UI
by
doxygen
1.9.8