Render form in variable, prevent direct echo
- AndiLeni
- Member | 8
Hello,
I am trying to integrate nette/forms into an application which is not based on the nette framework.
Unfortunately, I struggle with some points.
$form = new Form;
$form->setAction($action);
$form->setMethod('POST');
$form->addText('name', 'Name:');
$form->addPassword('password', 'Password:');
$form->addSubmit('send', 'Sign up');
return $form->render();
When I call ->render()
on my form, the form gets echoed
directly and hence breaks my page layout.
Is it possible to render the form as html into a variable which I can pass to
my templating system?
I tried passing the $form
directly, but this gives me a “Form
cloning is not supported yet.” exception.