1 | <?php |
||
13 | trait FieldsTrait { |
||
14 | public abstract function addFields($fields=NULL,$label=NULL); |
||
16 | |||
17 | protected function createItem($value){ |
||
27 | |||
28 | protected function createCondition($value){ |
||
31 | |||
32 | public function addInputs($inputs,$fieldslabel=null){ |
||
42 | |||
43 | public function addFieldRule($index,$type,$prompt=NULL,$value=NULL){ |
||
50 | |||
51 | public function addFieldRules($index,$rules){ |
||
58 | |||
59 | /** |
||
60 | * @param string $identifier |
||
61 | * @param array $items |
||
62 | * @param string $label |
||
63 | * @param string $value |
||
64 | * @param boolean $multiple |
||
65 | * @return \Ajax\common\html\HtmlDoubleElement |
||
66 | */ |
||
67 | public function addDropdown($identifier,$items=array(), $label=NULL,$value=NULL,$multiple=false){ |
||
70 | |||
71 | /** |
||
72 | * @param string $identifier |
||
73 | * @param string $label |
||
74 | * @param string $type |
||
75 | * @param string $value |
||
76 | * @param string $placeholder |
||
77 | * @return HtmlFormInput |
||
78 | */ |
||
79 | public function addInput($identifier, $label=NULL,$type="text",$value=NULL,$placeholder=NULL){ |
||
82 | |||
83 | public function addPassword($identifier, $label=NULL){ |
||
86 | |||
87 | public function addButton($identifier,$value,$cssStyle=NULL,$onClick=NULL){ |
||
90 | |||
91 | public function addCheckbox($identifier, $label=NULL,$value=NULL,$type=NULL){ |
||
94 | |||
95 | public function addRadio($identifier, $name,$label=NULL,$value=NULL){ |
||
98 | } |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: