Пример #1
0
 protected function getDynamicForm($id, $locale, $className = 'Zend_Form')
 {
     if (file_exists(PIMCORE_PLUGINS_PATH . "/Zendformbuilder/data/main_" . $id . ".json")) {
         $config = new Zend_Config_Json(PIMCORE_PLUGINS_PATH . "/Zendformbuilder/data/main_" . $id . ".json");
         $datas = $config->toArray();
         $builder = new Formbuilder_Builder();
         $builder->setDatas($datas);
         $builder->setLocale($locale);
         $array = $builder->buildDynamicForm();
         $form = $this->createInstance($array, $className);
         $this->initTranslation($form, $id, $locale);
         return $form;
     } else {
         return false;
     }
 }