Commit 4c5ea62a by Frédéric

feat(all): form template override

parent 08e1afd7
IdBookEngine : "b68c6848-b7d9-4083-91f0-3de6f065280e" IdBookEngine : "b68c6848-b7d9-4083-91f0-3de6f065280e"
form_template: "elloha/form.html.twig"
searchable_contenttypes: searchable_contenttypes:
- HCO - HCO
- HLO - HLO
......
...@@ -92,7 +92,7 @@ class EllohaExtension extends SimpleExtension ...@@ -92,7 +92,7 @@ class EllohaExtension extends SimpleExtension
]; ];
} }
/** /**
* @return string * @return string
*/ */
public function resaForm() public function resaForm()
...@@ -103,10 +103,15 @@ class EllohaExtension extends SimpleExtension ...@@ -103,10 +103,15 @@ class EllohaExtension extends SimpleExtension
'resaTypes' => $this->_getResaTypesForOptions(), 'resaTypes' => $this->_getResaTypesForOptions(),
])->getForm(); ])->getForm();
try {
return $this->renderTemplate($this->getConfig()['form_template'], [
'form' => $form->createView()
]);
} catch (\Exception $e) {
return $this->renderTemplate('@elloha/Frontend/generateForm.html.twig', [ return $this->renderTemplate('@elloha/Frontend/generateForm.html.twig', [
'form' => $form->createView() 'form' => $form->createView()
]); ]);
}
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment