title: Calling Model from View (Codeigniter)
body: <p>I am new to Codeingiter and i am building a Simple Blog. </p>
  
  <p>In Post table, i have "id, cat_id, title, content"... In category tablet i have "id, name"... </p>
  
  <p>To display post, </p>
  
  <p>i fetched contents from POST inside model using following function...</p>
  
  <pre><code>function get_posts(){
          $query = $this-&gt;db-&gt;get('post');
          return $query-&gt;result();
  }
  </code></pre>
  
  <p>Then i load the view file to display the post... The above function fetch only the CATEGORY ID, but i need Category name... So i need to call model from view file... I think it is illogical to call Model from view... is there any solution???</p>
  
  <p>Please help me...</p>
  
  <p>Thank you</p>