title: CodeIgniter and Bootstrap modal - passing data
body: <p>I have created a bootstrap modal mngCat that is inside views/modals folder, which I want to call in both cases, when I want to add a new category or when I want to edit an existing category.</p>
  
  <pre><code>&lt;div id="mngCat" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="addNewLabel" aria-hidden="true"&gt;
      &lt;div class="modal-header"&gt;
          &lt;h3 id="addNewLabel"&gt;&lt;?php echo empty($cat-&gt;category_id) ? 'Add category' : 'Edit category ' . $cat-&gt;category; ?&gt;&lt;/h3&gt;
      &lt;/div&gt;&lt;!-- end of .modal-header --&gt;
      &lt;div class="modal-body"&gt;
      &lt;?php echo form_open('admin/category/manage') . PHP_EOL; ?&gt;
          &lt;p&gt;
          &lt;label for="category_name"&gt;Category name:&lt;/label&gt;
      &lt;input type="text" name="category_name" value="&lt;?php echo set_value('category_name', $cat-&gt;category); ?&gt;" /&gt;
          &lt;/p&gt;
          &lt;p&gt;
          &lt;label for="parent"&gt;Set Parent category:&lt;/label&gt;
          &lt;select&gt;
          &lt;option&gt;-- None --&lt;/option&gt;
          &lt;?php if(count($all_categories)): foreach($all_categories as $cat): ?&gt;
          &lt;option value="&lt;?php echo $cat-&gt;category_id; ?&gt;"&gt;&lt;?php echo $cat-&gt;category; ?&gt;&lt;/option&gt;
          &lt;?php endforeach; endif; ?&gt;
          &lt;/select&gt;
          &lt;/p&gt;
          &lt;?php echo form_close() . PHP_EOL; ?&gt;
      &lt;/div&gt;
      &lt;div class="modal-footer"&gt;
          &lt;button class="btn btn-primary" type="submit"&gt;Ok&lt;/button&gt;
          &lt;button class="btn" data-dismiss="modal" aria-hidden="true"&gt;Close&lt;/button&gt;
      &lt;/div&gt;
  &lt;/div&gt;&lt;!-- end of #mngCat modal --&gt;
  </code></pre>
  
  <p>When I want to add a category I hit this ci anchor</p>
  
  <pre><code>$attr = array(
      'class' =&gt; 'btn btn-primary',
      'data-toggle' =&gt; 'modal',
      'data-target' =&gt; '#mngCat'
      );
  echo anchor('#mngCat','&lt;i class="icon-plus icon-white"&gt;&lt;/i&gt; Add Category', $attr);
  </code></pre>
  
  <p>and when I want to edit a category I hit this:</p>
  
  <pre><code>&lt;?php echo anchor('#mngCat' . $cat-&gt;category_id, $cat-&gt;category, $attr); //not passing any data  ?&gt;
  </code></pre>
  
  <p>So when I click Add Category the modal appears with title Add category, but when I click on the category name (2nd anchor) does not appear the modal. What I'd like to do is to display the modal with the title Edit category  and display in form the category data so that i can do the editing.</p>