✏️ 正在编辑: FormaPagamentoController.php
路径:
/srv/systems_dir/yuppiecred/application/controllers/FormaPagamentoController.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php class FormaPagamentoController extends Zend_Controller_Action { public function init() { /* Initialize action controller here */ } public function indexAction() { $form = new Form_Filtro_FormaPagamento(); $model = new Model_FormaPagamento(); $paginator = new Zend_Paginator(new Zend_Paginator_Adapter_Array($model->listar(null, "descricao ASC")->toArray())); $paginator->setCurrentPageNumber($this->_getParam('page', 1)); $this->view->paginator = $paginator; $this->view->form = $form; } public function saveAction() { $request = $this->getRequest(); $id = (int) $request->getParam('id'); $form = new Form_FormaPagamento(); if( $request->isPost() ){ if( $form->isValid($request->getPost()) ){ $formaPagamento = new Model_FormaPagamento($request->getPost()); try { $id = $formaPagamento->salvar($formaPagamento); $this->_helper->flashMessenger(array('success' => 'Dados salvos com sucesso.')); } catch ( Zend_Exception $e ) { $this->_helper->flashMessenger($e->getMessage()); } } } if( $id > 0 ){ $formaPagamento = new Model_FormaPagamento(); $dados = $formaPagamento->exibir($id); $form->populate($dados->toArray()); } $this->view->form = $form; } public function deleteAction() { $request = $this->getRequest(); $id = (int) $request->getParam('id'); if( $id > 0 ){ $formaPagamento = new Model_FormaPagamento(); $formaPagamento->excluir($id); } $this->_redirect('/forma-pagamento'); } }
💾 保存文件
← 返回文件管理器