/** * Helper function to create an NumberField. 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_NumberField */ public static function createNumberField($name, $label = null, $id = null) { $c = new PhpExt_Form_NumberField(); $c->setName($name); if ($label !== null) { $c->setFieldLabel($label); } if ($id !== null) { $c->setId($id); } return $c; }