phpMv
-UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
Loading...
Searching...
No Matches
CheckboxTrait.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Ajax\semantic\html\collections\form\traits
;
4
5
use
Ajax\semantic\html\base\constants\CheckboxType
;
6
use
Ajax\semantic\html\modules\checkbox\AbstractCheckbox
;
7
use
Ajax\semantic\html\collections\form\HtmlFormField
;
8
13
class
CheckboxTrait
{
14
15
abstract
public
function
addToPropertyCtrl
($name, $value, $typeCtrl);
16
17
public
function
setType
($checkboxType) {
18
return
$this->
getHtmlCk
()->addToPropertyCtrl(
"class"
, $checkboxType,
CheckboxType::getConstants
());
19
}
20
21
28
public
function
attachEvent
($selector, $action=NULL) {
29
return
$this->
getHtmlCk
()->attachEvent($selector, $action);
30
}
31
37
public
function
attachEvents
($events=array()) {
38
return
$this->
getHtmlCk
()->attachEvents($events);
39
}
40
41
public
function
getField
(){
42
return
$this->content[
"field"
];
43
}
44
45
public
function
getHtmlCk
(){
46
return
$this->content[
"field"
];
47
}
48
49
public
function
setName
($name){
50
$this->
getDataField
()->setProperty(
"name"
, $name);
51
return
$this;
52
}
53
54
public
function
getDataField
(){
55
$field= $this->
getField
();
56
if
($field instanceof
AbstractCheckbox
)
57
$field=$field->getField();
58
return
$field;
59
}
60
66
public
function
setChecked
($value=
true
){
67
if
($value===
true
){
68
$this->
getDataField
()->setProperty(
"checked"
,
"checked"
);
69
}
else
{
70
$this->
getDataField
()->removeProperty(
"checked"
);
71
}
72
return
$this;
73
}
74
75
}
Ajax\common\BaseEnum\getConstants
static getConstants()
Definition
BaseEnum.php:17
Ajax\semantic\html\base\constants\CheckboxType
Definition
CheckboxType.php:7
Ajax\semantic\html\collections\form\HtmlFormField
Definition
HtmlFormField.php:15
Ajax\semantic\html\collections\form\traits\CheckboxTrait
Definition
CheckboxTrait.php:13
Ajax\semantic\html\collections\form\traits\CheckboxTrait\setName
setName($name)
Definition
CheckboxTrait.php:49
Ajax\semantic\html\collections\form\traits\CheckboxTrait\attachEvent
attachEvent($selector, $action=NULL)
Attach $this to $selector and fire $action.
Definition
CheckboxTrait.php:28
Ajax\semantic\html\collections\form\traits\CheckboxTrait\getDataField
getDataField()
Definition
CheckboxTrait.php:54
Ajax\semantic\html\collections\form\traits\CheckboxTrait\getField
getField()
Definition
CheckboxTrait.php:41
Ajax\semantic\html\collections\form\traits\CheckboxTrait\attachEvents
attachEvents($events=array())
Attach $this to an array of $action=>$selector.
Definition
CheckboxTrait.php:37
Ajax\semantic\html\collections\form\traits\CheckboxTrait\getHtmlCk
getHtmlCk()
Definition
CheckboxTrait.php:45
Ajax\semantic\html\collections\form\traits\CheckboxTrait\setType
setType($checkboxType)
Definition
CheckboxTrait.php:17
Ajax\semantic\html\collections\form\traits\CheckboxTrait\setChecked
setChecked($value=true)
Check the checkbox.
Definition
CheckboxTrait.php:66
Ajax\semantic\html\collections\form\traits\CheckboxTrait\addToPropertyCtrl
addToPropertyCtrl($name, $value, $typeCtrl)
Ajax\semantic\html\modules\checkbox\AbstractCheckbox
Definition
AbstractCheckbox.php:8
Ajax\semantic\html\collections\form\traits
Definition
CheckboxTrait.php:3
Ajax
semantic
html
collections
form
traits
CheckboxTrait.php
Generated on Sun Dec 10 2023 16:16:05 for
phpMv-UI
by
doxygen
1.9.8