title: Custom error pages with templates in CodeIgniter
body: <p>I'm using the template library for CodeIgniter, <a href="http://williamsconcepts.com/ci/codeigniter/libraries/template/reference.html" rel="noreferrer">http://williamsconcepts.com/ci/codeigniter/libraries/template/reference.html</a>, and now I want to implement custom error pages too. I found one method involving a MY_Router extending the default router: <a href="http://maestric.com/doc/php/codeigniter_404" rel="noreferrer">http://maestric.com/doc/php/codeigniter_404</a> but that only treats 404 errors. I want all errors to show a simple user-friendly page, including database errors etc, and I want it to go through a controller, partly so I can use the template library, and partly so I can also implement an email function to send myself information about the error that occurred.</p>
  
  <p>Someone asked about extending the functionality of the above MY_Router method for other errors, like error_db, but got no answer from the author, so I'm turning here to see if anyone knows how to do this, along the lines of the above method or any other simple way of achieving it. Please note that I'm a newbie, so do not assume too much about my knowledge of basic CodeIgniter functionality :-)</p>