✏️ 正在编辑: CorretorDocumento.php
路径:
/srv/systems_dir/yuppiecred-lidernegocios/application/forms/CorretorDocumento.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php class Form_CorretorDocumento extends Core_Form { public function init() { $this->setAction($this->getView()->url(array( 'action' => 'add-documento' ))); $this->setName('sub_form_documento'); $this->addElement('hidden', 'corretor_id', array( 'class' => 'invisivel' )); $this->addElement('text', 'descricao', array( 'label' => 'Descrição:', 'size' => 25 )); $file = new Zend_Form_Element_File('arquivo'); $file->setLabel('Arquivo:') ->setRequired(true); $this->addElement($file); $this->addElement('submit', 'btn_adicionar', array( 'label' => 'Adicionar' )); $this->addDisplayGroup(array( 'corretor_id', 'descricao', 'arquivo', 'btn_adicionar' ), 'subform', array( 'legend' => 'Anexar Documentos' )); $this->_setDefaultDecorators(); $this->_populateGerenteId(); } protected function _setDefaultDecorators() { $this->setDecorators( array( 'FormElements', array( 'HtmlTag', array( 'tag' => 'dl', 'class' => 'sub_form2' ) ), 'Form' )); } protected function _populateGerenteId() { $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('corretor_id'); $elementId->setValue($id); } } protected function _getConveniosOptions() { $model = new Model_Convenio(); $options = array( '' => '' ); foreach ( $model->listar(null, 'nome ASC') as $convenio ) { $options[$convenio->id] = $convenio->nome; } return $options; } }
💾 保存文件
← 返回文件管理器