for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Ajax\semantic\html\collections\form\traits;
use Ajax\semantic\html\base\constants\CheckboxType;
trait CheckboxTrait {
public abstract function addToPropertyCtrl($name, $value, $typeCtrl);
public function setType($checkboxType) {
return $this->addToPropertyCtrl("class", $checkboxType, CheckboxType::getConstants());
}
/**
* Attach $this to $selector and fire $action
* @param string $selector jquery selector of the associated element
* @param string $action action to execute : check, uncheck or NULL for toggle
* @return \Ajax\semantic\html\collections\form\AbstractHtmlFormRadioCheckbox
*/
public function attachEvent($selector, $action=NULL) {
return $this->getHtmlCk()->attachEvent($selector, $action);
* Attach $this to an array of $action=>$selector
* @param array $events associative array of events to attach ex : ["#bt-toggle","check"=>"#bt-check","uncheck"=>"#bt-uncheck"]
public function attachEvents($events=array()) {
return $this->getHtmlCk()->attachEvents($events);
public function getField(){
return $this->content["field"]->getField();
content
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
public function getHtmlCk(){
return $this->content["field"];
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: