public function configure() { $timeZone = $this->getOption('timezone'); $date = $this->getOption('date'); $this->formWidgets['timezone'] = new sfWidgetFormSelect(array('choices' => $this->getTimezoneArray()), array('class' => 'timezone')); $this->setWidgets($this->formWidgets); $this->formValidators['timezone'] = new sfValidatorString(array(), array('required' => __('Enter timezone'))); $this->setValidators($this->formValidators); $this->widgetSchema->setNameFormat('attendance[%s]'); parent::configure(); $index = array_keys($this->getAttendanceService()->getTimezoneArray(), $timeZone); $this->setDefault('timezone', $index[0]); $this->setDefault('date', set_datepicker_date_format($date)); }