public function addAction() { $this->accessRights(13); //Accept Parent Module, Return Main Menu Lists with Active Menu Indicator $this->childModuleAccessRights(40, 'add'); //Accept Child Module ID & it's Actions: add, edit, view, disable $form_markethighlight = new MarketHighlightForm(); $request = $this->getRequest(); if ($request->isPost()) { // instantiate $markethighlight = new MarketHighlight(); $form_markethighlight->setInputFilter($markethighlight->getInputFilter()); // arrange data to form $form_markethighlight->setData($request->getPost()); if ($form_markethighlight->isValid()) { // get data from exchangeArray set value $markethighlight->exchangeArray($form_markethighlight->getData()); $this->getMarketHighlightTable()->saveMarketHighlight($markethighlight); // prepares audti trail parameters $from = $this->getRequest()->getPost()->toArray(); unset($from['addbuttonmarkethighlight'], $from['market_highlights_id']); $added = $this->prepare_added_data($from); // saves audit trail $this->save_to_audit_trail('Market Highlight', $added, '--', 'add', 40); $this->flashMessenger()->addMessage(['content' => 'market highlight save', 'type' => 'success']); } // reroute to index $this->redirect()->toRoute('markethighlight'); } }