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

[eluser]AndrewMalachel[/eluser]
Mmm... I think you could solved it a little easier if you just write these..
Code:
function [your_class_controller_name]() {
    parent::Controller();
    $this->master_view['footer'] = 'footer';
    $this->master_view['main_content'] = 'default'; // your default main_content
}

function one() {
    //[..]
    $this->master_view['main_content'] = 'content1';
    $this->_output();
}

// ... also the same to function 2 and 3

function _output() {
    $this->load->view('master_view', $this->master_view);
}
Anyway, you either can use any that you think suite you...
Also you can define the master_view variable in your class as an array:
Code:
Class [your_class_controller_name] extends Controller {
    var $master_view = array();

    function .... // and the rest just like above...
}
and use the master_view variable as above.. (with the '$this->...')

well, hope it works... Smile
(and I hope I don't confuse you even more!)


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