title: To pass dynamic data to a bootstrap modal
body: <p>I am trying to load the comments of a particular post on a modal. For this I need to pass the post id to the modal and then fetch the corresponding comments.
  The modal is triggered by the following:</p>
  
  
  
  <pre class="lang-html prettyprint-override"><code>&lt;a class="xyz" data-toggle="modal" data-target="#compose-modal" data-id="&lt;?php echo $list[$i]-&gt;getID(); ?&gt;"&gt;View Comments&lt;/a&gt;
  </code></pre>
  
  <p>And the modal is defined at the bottom of the page as follows:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div class="modal fade" id="compose-modal" tabindex="-1" role="dialog" aria-hidden="true"&gt;
      &lt;div class="modal-dialog"&gt;
          &lt;div class="modal-content"&gt;
  
          &lt;!-- here i need to use php to fetch the comments using post id --&gt;
          &lt;/div&gt;
     &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>