Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function editAction() {
- $bugReportForm = new Form_BugReportForm();
- $bugReportForm->setAction('/bug/edit');
- $bugReportForm->setMethod('post');
- $this->recordId = $this->_request->getParam('id');
- if ($this->getRequest()->isPost()) {
- if ($bugReportForm->isValid($_POST)) {
- $bugModel = new Model_Bug();
- // if the form is valid then update the bug
- $result = $bugModel->updateBug(
- $this->recordId,
- $bugReportForm->getValue('author'),
- $bugReportForm->getValue('email'),
- $bugReportForm->getValue('date'),
- $bugReportForm->getValue('url'),
- $bugReportForm->getValue('description'),
- $bugReportForm->getValue('priority'),
- $bugReportForm->getValue('status')
- );
- return $this->_forward('list');
- }
- } else {
- $id = $this->_request->getParam('id');
- $bug = $bugModel->find($id)->current();
- $bugReportForm->populate($bug->toArray());
- //format the date field
- $bugReportForm->getElement('date')->setValue(date('m-d-Y', $bug->date));
- }
- $this->view->form = $bugReportForm;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement