示例#1
0
文件: Radio.php 项目: beodob/php-ext
 /**
  * Helper function to create a Radio field.  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).
  * @return PhpExt_Form_Radio
  */
 public static function createRadio($name, $label = null, $id = null, $inputValue = null)
 {
     $c = new PhpExt_Form_Radio();
     $c->setName($name);
     if ($label !== null) {
         $c->setFieldLabel($label);
     }
     if ($id !== null) {
         $c->setId($id);
     }
     if ($inputValue !== null) {
         $c->setInputValue($inputValue);
     }
     return $c;
 }