Welcome Guest, Not a member yet? Register   Sign In
Repeating piece of code
#4

[eluser]loathsome[/eluser]
Did you call the auto function? Use the parent keyword to do so. In my current project, some of my controllers look like this:

Code:
class Blah extends BaseController {

function Blah() {
   parent::BaseController();
}

function index() {
  parent::data();
}

And the BaseController looks something like this:
Code:
class BaseController extends Controller {

function BaseController() {
   parent::Controller();
}

function data(){
   return $data = null; // blabla, fetches data here
}

}

Best of luck.


Messages In This Thread
Repeating piece of code - by El Forum - 07-15-2008, 03:01 PM
Repeating piece of code - by El Forum - 07-15-2008, 03:06 PM
Repeating piece of code - by El Forum - 07-15-2008, 04:10 PM
Repeating piece of code - by El Forum - 07-15-2008, 04:17 PM
Repeating piece of code - by El Forum - 07-16-2008, 11:35 AM



Theme © iAndrew 2016 - Forum software by © MyBB