How can i remove subclass_prefix? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: How can i remove subclass_prefix? (/showthread.php?tid=73915) |
How can i remove subclass_prefix? - frndmr - 06-24-2019 Hello, i want to remove subclass_prefix thing in my codeigniter project. How can i do that? I tried this. This doesnt work. I dont want to use subclass prefix. For now i solve this problem with a trick. I extend my Admin_Controller.php class from MY_Controller. This way is so complex. RE: How can i remove subclass_prefix? - dave friend - 06-24-2019 The 'subclass_prefix' is only used when extending a core class and then it MUST be used. There is no getting around it. RE: How can i remove subclass_prefix? - mladoux - 06-24-2019 Try this: https://markladoux.wordpress.com/2012/12/19/codeigniter-autoload-hook-by-shane-pearson-modified/ I've modified it when it stopped working with CI 2, but it should still work with CI 3. It doesn't remove the need to extend CI_Controller at some point, nor does it remove the need for a prefix. It does, however, remove the need to use the prefix specified in your configuration on controllers. Just make sure you extend the alternative base controller. |