title: Forcing CodeIgniter to execute hooks functionality?
body: <p>Hi I am facing a problem with hooks in Codeigniter.I have written  hook for <strong>'post_controller'</strong> which call a Controller function and load the template (Layout view template).It works fine for all normal cases. But now i need to make a custom error page.So i am overriding show_404() function.In this function i use the get_instance(); function to get the CI object.Using the CI object i am calling a function to set the layout parameters.Now the problem i am facing is that when i try to load the view in show_404() function of my custom exception class the view is not getting loaded as the <strong>post_controller</strong> hook is not getting executed.I tried a lot of things but failed.
  Can anyone please suggest me any way to do this.Or any other way to render custom 404 page.</p>
  
  <pre><code>function show_404($page = ''){ // error page logic
  
      header("HTTP/1.1 404 Not Found");
  $heading = "404 Page Not Found";
      $message = "The page you requested was not found ";
  $CI =&amp; get_instance();
  $metadata[AppContants::META_TITLE] = '404 Page Not Found | Door and Window';
  $metadata[AppContants::META_KEYWORDS] = '';
  $metadata[AppContants::META_DESCRIPTION] = '';
  $CI-&gt;setMeta($metadata);
  $params['LAYOUT_MAINVIEW']='404_page';
  $CI-&gt;renderView($params);// this is the function in my controller which sets the parameter for my template.Or it would also be very helpful if i can load the view directly as show below.
  $CI-&gt;load-&gt;view('404_page'); // Loading view directly.
  
  }
  </code></pre>