php-bootstrap-form
php-bootstrap-form copied to clipboard
Using with Templates
Hello and thank you for your work.
Is it possible to save the whole form in a Variable so i can send the output to a Template like Twig or Smarty?
Hello.
I have the same problem.
I use this workaround :
<?php
public static function getForm()
{
ob_start();
\Form::open("user", $_POST, ['view' => "SideBySide"]);
\Form::Hidden("Id");
\Form::Hidden('form', 'user');
\Form::TextBox(gettext("Nom") . " : ", "nom", array("required" => 1));
\Form::TextBox(gettext("Prenom") . " : ", "prenom", array("required" => 1));
\Form::Button(gettext("Enregistrer"));
\Form::Button(gettext("Annuler"), "button");
\Form::close(false);
$form = ob_get_contents();
ob_end_clean();
return $form;
}
?>