title: Call function in the controller from a model - codeigniter
body: <p>i have implement the php sdk for the facebook login in my project.. and all works with the login except the logout.</p>
  
  <p>how can i write the code to call a function from the controller to destroy the session?</p>
  
  <p>tried a lot of things but can´t get understand how can i do this..</p>
  
  <p>hope that somebody can help me with this.</p>
  
  <p>my model with the logouturl is this:</p>
  
  <pre><code>'logoutUrl' =&gt; $this-&gt;facebook-&gt;getLogoutUrl()
  </code></pre>
  
  <p>and the function in the controller is this:</p>
  
  <pre><code>public function logout()
  {   
       $this-&gt;CI-&gt;session-&gt;sess_destroy('logourUrl');
       $this-&gt;load-&gt;view('home');
       // do more thing you want to do such as redirect
  }
  </code></pre>