*/ class MailchimpConfigController extends BaseAdminController { public function showAction() { return $this->render("mailchimp-configuration"); } public function saveAction() { $baseForm = new MailchimpConfigurationForm($this->getRequest()); try { $form = $this->validateForm($baseForm); $data = $form->getData(); ConfigQuery::write(Mailchimp::CONFIG_NEWSLETTER_LIST_ID, $data["newsletter_list_id"]); ConfigQuery::write(Mailchimp::CONFIG_API_KEY, $data["api_key"]); ConfigQuery::write(Mailchimp::CONFIG_API_URL, $data["api_url"]); $this->getParserContext()->set("success", true); } catch (\Exception $e) { $this->getParserContext() ->setGeneralError($e->getMessage()) ->addForm($baseForm) ; } if ("close" === $this->getRequest()->request->get("save_mode")) { return new RedirectResponse(URL::getInstance()->absoluteUrl("/admin/modules")); } return $this->showAction(); } }