Пример #1
0
 /**
  * Helper function to create a ComboBox.  Useful for quick adding it to a ComponentCollection
  *
  * @param string $name The field's HTML name attribute.
  * @param string $labelThe 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 $hiddenName If specified, a hidden form field with this name is dynamically generated to store the field's data value (defaults to the underlying DOM element's name). Required for the combo's value to automatically post during a form submission.
  * @return PhpExt_Form_ComboBox
  */
 public static function createComboBox($name, $label = null, $id = null, $hiddenName = null)
 {
     $c = new PhpExt_Form_ComboBox();
     $c->setName($name);
     if ($label !== null) {
         $c->setFieldLabel($label);
     }
     if ($id !== null) {
         $c->setId($id);
     }
     if ($hiddenName !== null) {
         $c->setHiddenName($hiddenName);
     }
     return $c;
 }