Hamza Hamza -4 years ago 398
Twig Question

How can I get value from twig form?

Supposing I have a twig like this, how can I get input value from my controller?

{{form_start(form)}}
{{form_row(form.row1}}
{{form_row(form.row2}}
{{form_row(form.row3}}
<input id='someid'>
{{form_end(form}}

Answer Source

You can access as:

$request->request->get('someid', 'default values');

More info here and in this example from the doc

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download