SHARE
TWEET

Untitled

a guest Sep 18th, 2018 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $settings = $repSettings->findAllOrderedByCategory();
  2.  
  3. $settingForms = [];
  4. $settingTypes = ["text" => SettingsType::class, "bool" => SettingsBoolType::class, "file" => SettingsFileType::class];
  5.  
  6. /* @var $setting Setting */
  7. foreach ($settings as $setting) {
  8.     $settingType = isset($settingTypes[$setting->getType()]) ? $settingTypes[$setting->getType()] : $settingTypes["text"];
  9.     $urlSuffix = $setting->getType() == "file" ? "file" : "value";
  10.    
  11.     array_push($settingForms, $this->createForm($settingType, $setting, array(
  12.         'action' => $this->generateUrl(
  13.             'admin_set_setting_' . $urlSuffix,
  14.             array(
  15.                 "_locale" => $request->getLocale(),
  16.                 "_id" => $setting->getId() . "_" . uniqid()
  17.             )
  18.         )
  19.     ))->createView());
  20. }
  21.  
  22. return $this->render('admin/manage_settings.html.twig', array_merge(
  23.     array(
  24.         'settingForms'      => $settingForms,
  25.     )
  26. ));
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top