title: codeigniter, display dynamic dashboard
body: <p>I am using CodeIgniter framework. i want to show dashboard according to user type. I have 3 different user types and three different classes in different files. </p>
  
  <p>I want to inherit all three types of classes get in one class.  </p>
  
  <p>Basically, i am doing this to hide the name of class in URL</p>
  
  <p>Here is a sample of code.</p>
  
  <pre><code>class Dashboard extends CI_Controller {
  
   public $user_type
  
      function __construct() {
          parent::__construct();
          if (!$this-&gt;session-&gt;userdata('id'))  redirect('login');
          //print_r($userData); exit;
          $this-&gt;load-&gt;model("Dashboard_m");
          $user_type = $this-&gt;session-&gt;userdata['user_type'];
      }
  
      public function index()
      {
          if($user_type ==1) {
             admin_dashboard; // show diffent controller which is placed in diffrent file.
          }elseif($user_type ==2) {
             manager dashboard // show diffent dashboard which is placed in diffrent file.
          }else {
             Employee Dashboard // show diffent dashboard witch is placed in diffrent file.
          }
  
          $data['header']     = $this-&gt;load-&gt;view('header_v', null, true);
          $data['navmenu']    = $this-&gt;load-&gt;view('navmenu_v', null, true);
          $data['sidebar']    = $this-&gt;load-&gt;view('sidebar_v', null, true);
          $data['footer']     = $this-&gt;load-&gt;view('footer_v' , null, true);
  
          $this-&gt;load-&gt;view('dashboard_v', $data);
      }
  
  }
  </code></pre>
  
  <p>also i want to call functions placed in three other classes in this class.</p>