Welcome Guest, Not a member yet? Register   Sign In
In the interests of DRY
#1

[eluser]underskor[/eluser]
At the end of each of my controllers functions I am setting the same dynamic(ish) footer variables that are passed to the master view. I think _output is what I need to look into, but I can't find a great deal of documentation on it's use other than the user guide.

Is this how it works?
Code:
function one() {
//[..]
$master_view['main_content'] = 'content1';
}

function two() {
//[..]
$master_view['main_content'] = 'content2';
}

function three() {
//[..]
$master_view['main_content'] = 'content3';
}

function _output($master_view) {
    $master_view['footer'] = 'footer';
    $this->load->view('master_view', $master_view);
}

Could someone please share some examples of _output usage, or explain their method of coding to the DRY concept?


Messages In This Thread
In the interests of DRY - by El Forum - 01-12-2009, 08:16 PM
In the interests of DRY - by El Forum - 01-13-2009, 12:14 AM
In the interests of DRY - by El Forum - 01-13-2009, 12:38 AM
In the interests of DRY - by El Forum - 01-13-2009, 12:51 AM
In the interests of DRY - by El Forum - 01-13-2009, 12:57 AM
In the interests of DRY - by El Forum - 01-13-2009, 02:17 AM
In the interests of DRY - by El Forum - 01-13-2009, 07:47 PM
In the interests of DRY - by El Forum - 01-13-2009, 11:38 PM
In the interests of DRY - by El Forum - 01-14-2009, 12:02 AM
In the interests of DRY - by El Forum - 01-14-2009, 06:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB