| 1 | <?php |
||
| 7 | trait CheckboxTrait { |
||
| 8 | |||
| 9 | public abstract function addToPropertyCtrl($name, $value, $typeCtrl); |
||
| 10 | |||
| 11 | public function setType($checkboxType) { |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Attach $this to $selector and fire $action |
||
| 17 | * @param string $selector jquery selector of the associated element |
||
| 18 | * @param string $action action to execute : check, uncheck or NULL for toggle |
||
| 19 | * @return \Ajax\semantic\html\collections\form\AbstractHtmlFormRadioCheckbox |
||
| 20 | */ |
||
| 21 | public function attachEvent($selector, $action=NULL) { |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Attach $this to an array of $action=>$selector |
||
| 27 | * @param array $events associative array of events to attach ex : ["#bt-toggle","check"=>"#bt-check","uncheck"=>"#bt-uncheck"] |
||
| 28 | * @return \Ajax\semantic\html\collections\form\AbstractHtmlFormRadioCheckbox |
||
| 29 | */ |
||
| 30 | public function attachEvents($events=array()) { |
||
| 33 | |||
| 34 | public function getField(){ |
||
| 37 | |||
| 38 | public function getHtmlCk(){ |
||
| 41 | |||
| 42 | } |
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: