✏️ 正在编辑: PosvendaAdicionarOpcao.php
路径:
/srv/systems_dir/oakberry/application/forms/PosvendaAdicionarOpcao.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php class Form_PosvendaAdicionarOpcao extends Yuppie_Form_Save { public function init() { $this->setAttrib('enctype', 'multipart/form-data'); $this->setAction($this->getView()->url(array( 'action' => 'adicionar-opcao' ))); $this->addElement('hidden', 'pergunta_id', array( 'class' => 'invisivel' )); $this->addElement('text', 'opcao', array( 'label' => 'Opção:', 'size' => 20 )); $this->addElement('text', 'legenda', array( 'label' => 'Legenda:', 'size' => 20 )); $this->addElement('submit', 'btn_adicionar', array( 'label' => 'Adicionar', 'iconLeft' => 'glyphicon glyphicon-plus', 'buttonType' => 'success', 'ignore' => true, 'formnovalidate' => 'formnovalidate' )); $this->addDisplayGroup(array( 'pergunta_id', 'opcao', 'legenda', 'btn_adicionar' ), 'subform', array( 'legend' => 'Opções' )); $this->_populatePerguntaId(); } protected function _populatePerguntaId() { $front = Zend_Controller_Front::getInstance(); //pega o id do cliente $id = (int) $front->getRequest()->getParam('id'); //verifica se passou o id por parâmetro if( $id > 0 ){ $elementId = $this->getElement('pergunta_id'); $elementId->setValue($id); } } }
💾 保存文件
← 返回文件管理器