public function createTemplateAction() { $templateType = $this->_getParam('type', null); $request = $this->getRequest(); $params = $request->getPost(); try { $historyService = new Application_Service_HistoryService(); $supportedTypes = $historyService->getSupportedTemplateTypes(); if (!in_array($templateType, $supportedTypes)) { throw new Exception("Error: {$templateType} is not supported."); } $id = $historyService->createTemplate($params); $this->view->url = $this->view->baseUrl("Playouthistorytemplate/configure-template/id/{$id}"); } catch (Exception $e) { Logging::info($e); Logging::info($e->getMessage()); $this->view->error = $e->getMessage(); } }