title: Codeigniter Filters
body: <p>I am working on the admin side of a site that I am building and wanted to lock it down. I already figured out how to do my authentication, but I am looking for a way to call this authentication function on every request being made in this controller without having to call it at the beginning of each controller method. Is there a way to pass request through a filter, or something of the sort, in the constructor?</p>
  
  <p>Ex.
  <code>
      public function __construct() 
      {
        filter(authenticate(), 'login,signin');
      } 
  </code>
  Where the first parameter is the method being called, and the second parameter is the methods to exclude from the filter. Because you wouldn’t want to check for a logged in user if they are on the login page or if the signin method is being used since it is the one logging them in. Does anyone know if there is a way to do this? I think it would cut back on me repeating the call to authenticate before each locked down method.</p>
  
  <p>Thanks!</p>
  
  <p><strong>Figured it out</strong></p>
  
  <p><a href="http://codeigniter.com/user_guide/general/controllers.html#remapping" rel="nofollow">Remapping</a> looks to have done what I was looking for. Be sure to look into it! Great function :)</p>