php - Symfony2 form variable not viewing in an included template -
In some of a dosage, I am trying to render a form in a template, which is a template The template has been included in.
In my Controller:
Public function searchInvSumAction (Request $ request) {$ form = $ this- & gt; CreateFormbuilder () - & gt; Add ('fromdate', 'date', array ('label' = 'gtc:' ',' widget '= & gt;' single_text ')) - & gt; Add ('todate', 'date', array ('label' = & gt; 'to:', 'widget' = & gt; 'single_text')) - & gt; Add ('generated', 'submit') - & gt; GetForm (); $ $ --- ($ CIRBundle: Reports: index.html.twig, Return Array ('invsum' & gt; $ form- & gt; createView ());} index.html.twig template:
// code ........ Input type = "radio" name = "tab" id Labels for & lt; div id = "tab-content3" class = "Tab 3" & gt; & lt; label = "tab3" class = "tab" & gt; Inventory summary & lt; / label & gt; "Tab-content animated feedin" & gt; {{('CIRBundle: Report: invsum.html.twig')}} & lt; / li & gt; // More Code. .. and include the template invsum.html.twig:
{{form (invsum)}} < p> me The message is available: Variable "invsum" does not exist in the CIRbundle: report: invsum.html.twig on line 4 When I invsum Trying to render the form in html.twig, I still get this error that the variable does not exist any help?
You did not pass the index from invsum .html.twig to invsum.html.twig < p> Try {{contains ('CIR Bundle: Report: Ins Even html.twig ', {' invsum ': invsum})}}
php स्क्रिप्ट कोड उदाहरण
ReplyDeleteसरणी सामग्री नमूना कोड प्रदर्शित करें