title: Send data from one template to another in symfony2
body: <p>I have one twig file named <code>index.html.twig</code> as follow:</p>
  
  <pre><code>&lt;div class="tab-pane" id="2"&gt;
  
                      &lt;div class="control-group component" rel="popover" title="Search Input" trigger="manual"
                        data-content="
                        &lt;form class='form'&gt;
                          &lt;div class='controls'&gt;
                            &lt;label class='control-label'&gt;Label Text&lt;/label&gt; &lt;input class='input-large' type='text' name='label' id='label'&gt;
                            &lt;label class='control-label'&gt;Options: &lt;/label&gt;
                            &lt;textarea style='min-height: 200px' id='option'&gt; &lt;/textarea&gt;
                            &lt;hr/&gt;
                            &lt;button class='btn btn-info'&gt;Save&lt;/button&gt;&lt;button class='btn btn-danger'&gt;Cancel&lt;/button&gt;
                          &lt;/div&gt;
                        &lt;/form&gt;"
                        &gt;
  
                        &lt;!-- Select Basic --&gt;
                        &lt;label class="control-label valtype" data-valtype="label"&gt;Select - Basic&lt;/label&gt;
                        &lt;div class="controls"&gt;
                          &lt;select class="input-xlarge valtype" data-valtype="option"&gt;
                            &lt;option&gt;Enter&lt;/option&gt;
                            &lt;option&gt;Your&lt;/option&gt;
                            &lt;option&gt;Options&lt;/option&gt;
                            &lt;option&gt;Here!&lt;/option&gt;
                          &lt;/select&gt;
                        &lt;/div&gt;
  
                      &lt;/div&gt;
  
                      &lt;div class="control-group component" rel="popover" title="Search Input" trigger="manual"
                        data-content="
                        &lt;form class='form'&gt;
                          &lt;div class='controls'&gt;
                            &lt;label class='control-label'&gt;Label Text&lt;/label&gt; &lt;input class='input-large' type='text' name='label' id='label'&gt;
                            &lt;label class='control-label'&gt;Options: &lt;/label&gt;
                            &lt;textarea style='min-height: 200px' id='option'&gt;&lt;/textarea&gt;
                            &lt;hr/&gt;
                            &lt;button class='btn btn-info'&gt;Save&lt;/button&gt;&lt;button class='btn btn-danger'&gt;Cancel&lt;/button&gt;
                          &lt;/div&gt;
                        &lt;/form&gt;"
                        &gt;
  
                        &lt;!-- Select Multiple --&gt;
                        &lt;label class="control-label valtype" data-valtype="label"&gt;Select - Multiple&lt;/label&gt;
                        &lt;div class="controls"&gt;
                          &lt;select class="input-xlarge valtype" multiple="multiple" data-valtype="option"&gt;
                            &lt;option&gt;Enter&lt;/option&gt;
                            &lt;option&gt;Your&lt;/option&gt;
                            &lt;option&gt;Options&lt;/option&gt;
                            &lt;option&gt;Here!&lt;/option&gt;
                          &lt;/select&gt;
                        &lt;/div&gt;
                      &lt;/div&gt;
  
                    &lt;/div&gt;
  
                    &lt;div class="tab-pane" id="3"&gt;
  
                      &lt;div class="control-group component" rel="popover" title="Multiple Checkboxes" trigger="manual"
                        data-content="
                        &lt;form class='form'&gt;
                          &lt;div class='controls'&gt;
                            &lt;label class='control-label'&gt;Label Text&lt;/label&gt; &lt;input class='input-large' type='text' name='label' id='label'&gt;
                            &lt;label class='control-label'&gt;Options: &lt;/label&gt;
                            &lt;textarea style='min-height: 200px' id='checkboxes'&gt; &lt;/textarea&gt;
                            &lt;hr/&gt;
                            &lt;button class='btn btn-info'&gt;Save&lt;/button&gt;&lt;button class='btn btn-danger'&gt;Cancel&lt;/button&gt;
                          &lt;/div&gt;
                        &lt;/form&gt;"
                        &gt;
                        &lt;label class="control-label valtype" data-valtype="label"&gt;Checkboxes&lt;/label&gt;
                        &lt;div class="controls valtype" data-valtype="checkboxes"&gt;
  
                          &lt;!-- Multiple Checkboxes --&gt;
                          &lt;label class="checkbox"&gt;
                            &lt;input type="checkbox" value="Option one"&gt;
                            Option one
                          &lt;/label&gt;
                          &lt;label class="checkbox"&gt;
                            &lt;input type="checkbox" value="Option two"&gt;
                            Option two
                          &lt;/label&gt;
                        &lt;/div&gt;
  
                      &lt;/div&gt;
  
                      &lt;div class="control-group component" rel="popover" title="Multiple Radios" trigger="manual"
                        data-content="
                        &lt;form class='form'&gt;
                          &lt;div class='controls'&gt;
                            &lt;label class='control-label'&gt;Label Text&lt;/label&gt; &lt;input class='input-large' type='text' name='label' id='label'&gt;
                            &lt;label class='control-label'&gt;Group Name Attribute&lt;/label&gt; &lt;input class='input-large' type='text' name='name' id='name'&gt;
                            &lt;label class='control-label'&gt;Options: &lt;/label&gt;
                            &lt;textarea style='min-height: 200px' id='radios'&gt;&lt;/textarea&gt;
                            &lt;hr/&gt;
                            &lt;button class='btn btn-info'&gt;Save&lt;/button&gt;&lt;button class='btn btn-danger'&gt;Cancel&lt;/button&gt;
                          &lt;/div&gt;
                        &lt;/form&gt;"
                        &gt;
                        &lt;label class="control-label valtype" data-valtype="label"&gt;Radio buttons&lt;/label&gt;
                        &lt;div class="controls valtype" data-valtype="radios"&gt;
  
                          &lt;!-- Multiple Radios --&gt;
                          &lt;label class="radio"&gt;
                            &lt;input type="radio" value="Option one" name="group" checked="checked"&gt;
                            Option one
                          &lt;/label&gt;
                          &lt;label class="radio"&gt;
                            &lt;input type="radio" value="Option two" name="group"&gt;
                            Option two
                          &lt;/label&gt;
                        &lt;/div&gt;
  
                      &lt;/div&gt;
  
                      &lt;div class="control-group component" rel="popover" title="Inline Checkboxes" trigger="manual"
                        data-content="
                        &lt;form class='form'&gt;
                          &lt;div class='controls'&gt;
                            &lt;label class='control-label'&gt;Label Text&lt;/label&gt; &lt;input class='input-large' type='text' name='label' id='label'&gt;
                            &lt;textarea style='min-height: 200px' id='inline-checkboxes'&gt;&lt;/textarea&gt;
                            &lt;hr/&gt;
                            &lt;button class='btn btn-info'&gt;Save&lt;/button&gt;&lt;button class='btn btn-danger'&gt;Cancel&lt;/button&gt;
                          &lt;/div&gt;
                        &lt;/form&gt;"
                        &gt;
                        &lt;label class="control-label valtype" data-valtype="label"&gt;Inline Checkboxes&lt;/label&gt;
  
                        &lt;!-- Multiple Checkboxes --&gt;
                        &lt;div class="controls valtype" data-valtype="inline-checkboxes"&gt;
                          &lt;label class="checkbox inline"&gt;
                            &lt;input type="checkbox" value="1"&gt; 1
                          &lt;/label&gt;
                          &lt;label class="checkbox inline"&gt;
                            &lt;input type="checkbox" value="2"&gt; 2
                          &lt;/label&gt;
                          &lt;label class="checkbox inline"&gt;
                            &lt;input type="checkbox" value="3"&gt; 3
                          &lt;/label&gt;
                        &lt;/div&gt;
  
                      &lt;/div&gt;
  
                      &lt;div class="control-group component" rel="popover" title="Inline radioes" trigger="manual"
                        data-content="
                        &lt;form class='form'&gt;
                          &lt;div class='controls'&gt;
                            &lt;label class='control-label'&gt;Label Text&lt;/label&gt; &lt;input class='input-large' type='text' name='label' id='label'&gt;
                            &lt;label class='control-label'&gt;Group Name Attribute&lt;/label&gt; &lt;input class='input-large' type='text' name='name' id='name'&gt;
                            &lt;textarea style='min-height: 200px' id='inline-radios'&gt;&lt;/textarea&gt;
                            &lt;hr/&gt;
                            &lt;button class='btn btn-info'&gt;Save&lt;/button&gt;&lt;button class='btn btn-danger'&gt;Cancel&lt;/button&gt;
                          &lt;/div&gt;
                        &lt;/form&gt;"
                        &gt;
                        &lt;label class="control-label valtype" data-valtype="label"&gt;Inline radios&lt;/label&gt;
                        &lt;div class="controls valtype" data-valtype="inline-radios"&gt;
  
                          &lt;!-- Inline Radios --&gt;
                          &lt;label class="radio inline"&gt;
                            &lt;input type="radio" value="1" checked="checked" name="group"&gt;
                            1
                          &lt;/label&gt;
                          &lt;label class="radio inline"&gt;
                            &lt;input type="radio" value="2" name="group"&gt;
                            2
                          &lt;/label&gt;
                          &lt;label class="radio inline"&gt;
                            &lt;input type="radio" value="3"&gt;
                            3
                          &lt;/label&gt;
                        &lt;/div&gt;
                      &lt;/div&gt;
  
                    &lt;/div&gt;
  
                    &lt;div class="tab-pane" id="4"&gt;
                      &lt;div class="control-group component" rel="popover" title="File Upload" trigger="manual"
                        data-content="
                        &lt;form class='form'&gt;
                          &lt;div class='controls'&gt;
                            &lt;label class='control-label'&gt;Label Text&lt;/label&gt; &lt;input class='input-large' type='text' name='label' id='label'&gt;
                            &lt;hr/&gt;
                            &lt;button class='btn btn-info'&gt;Save&lt;/button&gt;&lt;button class='btn btn-danger'&gt;Cancel&lt;/button&gt;
                          &lt;/div&gt;
                        &lt;/form&gt;"
                        &gt;
                        &lt;label class="control-label valtype" data-valtype="label"&gt;File Button&lt;/label&gt;
  
                        &lt;!-- File Upload --&gt;
                        &lt;div class="controls"&gt;
                          &lt;input class="input-file" id="fileInput" type="file"&gt;
                        &lt;/div&gt;
                      &lt;/div&gt;
  
                      &lt;div class="control-group component" rel="popover" title="Search Input" trigger="manual"
                        data-content="
                        &lt;form class='form'&gt;
                          &lt;div class='controls'&gt;
                            &lt;label class='control-label'&gt;Label Text&lt;/label&gt; &lt;input class='input-large' type='text' name='label' id='label'&gt;
                            &lt;label class='control-label'&gt;Button Text&lt;/label&gt; &lt;input class='input-large' type='text' name='label' id='button'&gt;
                            &lt;label class='control-label' id=''&gt;Type: &lt;/label&gt;
                            &lt;select class='input' id='color'&gt;
                              &lt;option id='btn-default'&gt;Default&lt;/option&gt;
                              &lt;option id='btn-primary'&gt;Primary&lt;/option&gt;
                              &lt;option id='btn-info'&gt;Info&lt;/option&gt;
                              &lt;option id='btn-success'&gt;Success&lt;/option&gt;
                              &lt;option id='btn-warning'&gt;Warning&lt;/option&gt;
                              &lt;option id='btn-danger'&gt;Danger&lt;/option&gt;
                              &lt;option id='btn-inverse'&gt;Inverse&lt;/option&gt;
                            &lt;/select&gt;
                            &lt;hr/&gt;
                            &lt;button class='btn btn-info'&gt;Save&lt;/button&gt;&lt;button class='btn btn-danger'&gt;Cancel&lt;/button&gt;
                          &lt;/div&gt;
                        &lt;/form&gt;"
                        &gt;
                        &lt;label class="control-label valtype" data-valtype="label"&gt;Button&lt;/label&gt;
  
                        &lt;!-- Button --&gt;
                        &lt;div class="controls valtype"  data-valtype="button"&gt;
                          &lt;button class='btn btn-success'&gt;Button&lt;/button&gt;
                        &lt;/div&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
  
  
                    &lt;div class="tab-pane" id="5" name="textsource"&gt;
                      &lt;textarea id="source" class="span6"&gt;&lt;/textarea&gt;
                    &lt;/div&gt;
  </code></pre>
  
  <p>In this div <code>id="5"</code>, it is getting the dynamic data. Now I want to transfer this textarea of <code>id="5"</code>in another twig file named <code>sub.html.twig</code>. What should I do?</p>