/** * Helper function to create a DateField. 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_DateField */ public static function createDateField($name, $label = null, $id = null) { $c = new PhpExt_Form_DateField(); $c->setName($name); if ($label !== null) { $c->setFieldLabel($label); } if ($id !== null) { $c->setId($id); } return $c; }