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