em = $em; $this->translatorAdmin = $translatorAdmin; $this->siteSettingRepository = $siteSettingRepository; $this->siteSettingDefinition = $siteSettingDefinition; $this->siteRepository = $siteRepository; } /** * @Route("/admin/setting/site", name="sov_admin_setting_site") */ public function manageGlobal(Request $request) { $site = $this->siteRepository->findOneByDevAlias('default') ; $form = $this->createForm(SiteSettingsFormType::class, $site); $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { $this->em->update($site); $this->em->flush(); $this->addFlash('success', $this->translatorAdmin->transFlashMessage('settings_saved')); } return $this->render( '@LcSov/admin/setting/edit_site.html.twig' , [ 'setting_definition' => $this->siteSettingDefinition, 'form' => $form->createView() ] ); } }