Custom Exception & get_instance() |
(04-18-2017, 08:48 AM)petewulf1 Wrote: The Problem is, that the whole CI-Exception class works like a standalone class without any CI core functionality like loading models, helpers and so on. I get that. What I don't get is what you need from the core for your 404 page. Do you need the instance while the framework is in bootstrap phase - IOW, while executing CodeIgniter.php? If your "need to call show_404() manually" happens after the framework is up and running then a custom 404 method in your extension of CI_Exception could be devised that will maybe do the trick. PHP Code: class MY_Exceptions extends CI_Exceptions You would need to create a helper to allow a simple function call in the way show_404() is used. File: application/helpers/custom404_helper.php PHP Code: if ( ! function_exists('show_custom_404')) So within some controller or other place in a fully instantiated framework (a place where $this is an instance of $CI)... PHP Code: show_custom_404($page, TRUE, $this); Does that help? |
Messages In This Thread |
Custom Exception & get_instance() - by petewulf1 - 04-18-2017, 04:21 AM
RE: Custom Exception & get_instance() - by dave friend - 04-18-2017, 07:45 AM
RE: Custom Exception & get_instance() - by petewulf1 - 04-18-2017, 08:48 AM
RE: Custom Exception & get_instance() - by dave friend - 04-18-2017, 10:53 AM
RE: Custom Exception & get_instance() - by petewulf1 - 04-19-2017, 01:35 AM
|