title: best pratices and benefits of partal views in codeigniter
body: <p>I have googled for partial views usage and benefits but I didn't get useful references so thought of posting a question here. Basically I have a list of common html code to place in a common file and call/load that view wherever it included to avoid duplication of code so that whenever if something needs to be changed I will not change in all places I will just modify at common view where I kept my code.</p>
  <p><strong>My question here is I can load that common view with 2 types that is from controller I can pass with a $data['variable_name'] and use that with 'variable_name directly in the view or I can simply load that common view within a view like '$this-&gt;load-&gt;view('common_folder_name/my_partial_view')'</strong></p>
  <p>I just want to know which method is the best one to use and benefits of using that method? Also any disadvantages of using that method.</p>
  <p><strong>Method:1</strong></p>
  <p>My_controller_name:</p>
  <pre><code>$data['users_types'] = $this-&gt;load-&gt;view('common/users_type',NULL,TRUE);
  </code></pre>
  <p>My_view_name:</p>
  <pre><code>&lt;?php echo $users_types; ?&gt;
  </code></pre>
  <p><strong>Method:2</strong></p>
  <p>My_view_name:</p>
  <pre><code>$this-&gt;load-&gt;view('common/users_type');
  </code></pre>
  <p>Which method is best to use and benefits..! Any help would be appreciated, Thanks.</p>