public function configure() { // Note: Widget names were kept from old non-symfony version $this->setWidgets(array('txtEmployeeId' => new sfWidgetFormInputText(), 'txtEmpFirstName' => new sfWidgetFormInputText(), 'txtEmpMiddleName' => new sfWidgetFormInputText(), 'txtEmpLastName' => new sfWidgetFormInputText(), 'txtEmpNickName' => new sfWidgetFormInputText(), 'MAX_FILE_SIZE' => new sfWidgetFormInputHidden(), 'photofile' => new sfWidgetFormInputFile())); $employeeService = new EmployeeService(); $this->setDefault('txtEmployeeId', $employeeService->getDefaultEmployeeId()); $this->setValidators(array('txtEmployeeId' => new sfValidatorString(array('required' => false)), 'txtEmpFirstName' => new sfValidatorString(array('required' => true), array('required' => 'First Name Empty!')), 'txtEmpMiddleName' => new sfValidatorString(array('required' => false)), 'txtEmpLastName' => new sfValidatorString(array('required' => true), array('required' => 'Last Name Empty!')), 'txtEmpNickName' => new sfValidatorString(array('required' => false)), 'MAX_FILE_SIZE' => new sfValidatorString(array('required' => true)), 'photofile' => new sfValidatorFile(array('required' => false)))); }