$value) { $this->getForm()->addText('answers['.$key.']', $key + 1); } } parent::addRemoveButtons($formData); } /** * @param FormValidator $form * @param array $questionData * @param array $answers * @return void */ public function render(FormValidator $form, $questionData = array(), $answers = array()) { $name = 'question'.$questionData['question_id']; $data = array(0 => '--') + $questionData['options']; $form->addSelect($name, null, $data); if (!empty($answers)) { $form->setDefaults([$name => $answers]); } } }