Welcome Guest, Not a member yet? Register   Sign In
Frontend and Backend (Base controllers)
#5

[eluser]PhilTem[/eluser]
Nope, that's not what @Aken suggested. He was suggesting to create a file MY_Controller, which holds multiple classes e.g.

Code:
<?php

class MY_Controller extends CI_Controller {}

class Frontend_Controller extends MY_Controller {}

class Backend_Controller extends MY_Controller {}
// and so on and so forth

That's got nothing to do with DRY code, it's even better than having let's say 20 class files in APPPATH . 'core/' Wink

The advantage of this over the __autoload function: Once the MY_Controller file got included by the Loader class, all other classes can be instantiated easily and directly without even using a __autoload function thus kinda speeding up the application, as well Wink


Messages In This Thread
Frontend and Backend (Base controllers) - by El Forum - 01-20-2013, 08:47 PM
Frontend and Backend (Base controllers) - by El Forum - 01-20-2013, 08:50 PM
Frontend and Backend (Base controllers) - by El Forum - 01-20-2013, 10:55 PM
Frontend and Backend (Base controllers) - by El Forum - 01-21-2013, 07:37 AM
Frontend and Backend (Base controllers) - by El Forum - 01-21-2013, 07:57 AM
Frontend and Backend (Base controllers) - by El Forum - 01-21-2013, 08:10 AM
Frontend and Backend (Base controllers) - by El Forum - 01-21-2013, 04:58 PM
Frontend and Backend (Base controllers) - by El Forum - 01-21-2013, 06:00 PM
Frontend and Backend (Base controllers) - by El Forum - 01-21-2013, 08:36 PM
Frontend and Backend (Base controllers) - by El Forum - 01-21-2013, 10:49 PM
Frontend and Backend (Base controllers) - by El Forum - 01-22-2013, 12:21 AM
Frontend and Backend (Base controllers) - by El Forum - 01-22-2013, 12:45 AM
Frontend and Backend (Base controllers) - by El Forum - 01-22-2013, 12:58 AM
Frontend and Backend (Base controllers) - by El Forum - 01-23-2013, 07:27 PM
Frontend and Backend (Base controllers) - by El Forum - 01-23-2013, 09:22 PM



Theme © iAndrew 2016 - Forum software by © MyBB