em = $em; $this->translatorAdmin = $translatorAdmin; $this->siteSettingRepository = $siteSettingRepository; $this->siteSettingDefinition = $siteSettingDefinition; $this->siteRepository = $siteRepository; } 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/global.html.twig' , [ 'setting_definition' => $this->siteSettingDefinition, 'form' => $form->createView() ] ); } }