Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Icefusion_View_Helper_Admin_Forms_SkuOptions extends Zend_Form{
- public function getFormCadastro($data) {
- $form = new Zend_Form;
- $form->setMethod('post');
- $form->setAction('/admin/skuoptions/save');
- $form->setAttrib('enctype', 'multipart/form-data');
- $form->setAttrib('id', 'form-application');
- $sku = new Zend_Form_Element_Select('sku_id', array('label' => 'Sku:', 'class' => 'select2 borda-arredondada'));
- $sku->addDecorators(array('ViewHelper', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'row2'))));
- $skuList = new Application_Model_Sku();
- $result = $skuList->fetchAll('id > 0','name')->toArray();
- $options = array();
- foreach ($result as $value) {
- $options[$value['id']] = $value['name'];
- }
- $sku->setMultiOptions($options);
- $sku->setRequired(true);
- $form->addElement($sku);
- $nome = $form->createElement('text', 'name', array('label' => 'Nome:', 'class' => 'campos4 borda-arredondada'))->setRequired(true);
- $nome->addDecorators(array('ViewHelper', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'row4'))));
- $form->addElement($nome);
- $color = $form->createElement('text', 'color', array('label' => 'Cor:', 'class' => 'campos1 borda-arredondada'))->setRequired(true);
- $color->addDecorators(array('ViewHelper', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'row1'))));
- $form->addElement($color);
- $arquivojpg = new Zend_Form_Element_File('arquivojpg');
- $arquivojpg->setLabel('Enviar Perspectiva JPG:');
- $arquivojpg->addValidator('Count', false, 1);
- $arquivojpg->addValidator('Extension', false, 'jpg');
- $arquivojpg->addDecorators(array('File', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'row3'))));
- $form->addElement($arquivojpg);
- $arquivoswf = new Zend_Form_Element_File('arquivoswf');
- $arquivoswf->setLabel('Enviar Perspectiva SWF:');
- $arquivoswf->addValidator('Count', false, 1);
- //$arquivoswf->addValidator('Extension', false, 'swf');
- $arquivoswf->addDecorators(array('File', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'row3'))));
- $form->addElement($arquivoswf);
- $id = $form->createElement('hidden', 'id');
- $form->addElement($id);
- $submit = $form->createElement('submit', 'submit', array('label' => 'Salvar', 'class' => 'btn btn-salvar'));
- $submit->addDecorators(array('ViewHelper', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'row2'))));
- $form->addElement($submit);
- $limpar = $form->createElement('button', 'button', array('label' => 'Limpar', 'class' => 'btn btn-limpar'));
- $limpar->addDecorators(array('ViewHelper', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'row2'))));
- $form->addElement($limpar);
- if ($data) {
- $form->populate($data);
- }
- return $form;
- //$form->addElement('hash', 'csrf');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment