[eluser]crumpet[/eluser]
Hi,
I've been working on a site for sometime now and am currently at a stage where I'm just going back through and trying to clean things up a bit.
All five controllers use a couple of the same functions and right now they just repeat.
The most important one is _run() which all the methods call to display a page. Each controller's version of _run() is slightly different however they all share a few declarations that are exactly for same. For instance they all have a line of code which declares a $this->template['accountInfo'] variable so the loader file knows whether to display a login box or account options box. And they all do things like set the $this->template['title'] variable. However they differ for variables like $this->template['currentTab'] which is different for each controller (determines which tab appears selected in the navigation). Basically what i want is a way to do this
Code:
function _run(){
//Paste code from a file which contains the standard declarations that all controllers need
//declare the variables that are different like normal
}
can this be done??