_getNewForm(); if ($form->validate()) { $data = $form->getValues(); $form->getElement('dump')->setValue(nl2br(var_export($data, true))); if (isset($data['image'])) { $adapter = new Qs_File_Transfer_Adapter_Db(); $adapter->delete($data['image'], 'image'); } } $this->_addFormItem($form); return $this; } protected function _getNewForm() { $form = new Qs_Form($this->_getFormOptions()); $form->addElement('hidden', 'action', array('value' => 'insert')); $this->_bindFormFields($form); return $form; } protected function _bindFormFields(Qs_Form $form) { $form->addElement('static', 'dump', array('label' => 'SUBMITTED VALUES')); $form->addElement( 'file', 'image', array( 'label' => 'File', ) ); $form->getElement('image')->addValidator('PngHasTransparency'); return $this; } }