Esempio n. 1
0
 /**
  * Helper function to create a Checkbox.  Useful for quick adding it to a ComponentCollection
  *
  * @param string $name The field's HTML name attribute.
  * @param string $label The label text to display next to this field (defaults to '')
  * @param string $id The unique id of this component (defaults to an auto-assigned id).
  * @param string $inputValue The value when the field is checked
  * @return PhpExt_Form_Checkbox
  */
 public static function createCheckbox($name, $label = null, $id = null, $inputValue = null)
 {
     $c = new PhpExt_Form_Checkbox();
     $c->setName($name);
     if ($label !== null) {
         $c->setFieldLabel($label);
     }
     if ($id !== null) {
         $c->setId($id);
     }
     if ($inputValue !== null) {
         $c->setInputValue($inputValue);
     }
     return $c;
 }