Welcome Guest, Not a member yet? Register   Sign In
Construct & destruct - quick question
#7

[eluser]Phil Sturgeon[/eluser]
Thinking about it, you could do this:

Code:
class Welcome extends Controller()
{
    function index()
    {
        $this->load->view('content');
    }

    function something_else()
    {
        $this->load->view('something_else');
    }

    function _output($output)
    {
        $this->load->view('header', $this->data, TRUE);
        echo $output;
        $this->load->view('footer', $this->data, TRUE);
    }

}

Let me know how that works out for you. The CodeIgniter user guide does mention:

Quote:Please note that your _output() function will receive the data in its finalized state. Benchmark and memory usage data will be rendered, cache files written (if you have caching enabled), and headers will be sent (if you use that feature) before it is handed off to the _output() function. If you are using this feature the page execution timer and memory usage stats might not be perfectly accurate since they will not take into account any further processing you do. For an alternate way to control output before any of the final processing is done, please see the available methods in the Output Class.


Messages In This Thread
Construct & destruct - quick question - by El Forum - 06-29-2009, 07:28 AM
Construct & destruct - quick question - by El Forum - 06-29-2009, 07:36 AM
Construct & destruct - quick question - by El Forum - 06-29-2009, 07:38 AM
Construct & destruct - quick question - by El Forum - 06-29-2009, 07:47 AM
Construct & destruct - quick question - by El Forum - 06-29-2009, 08:01 AM
Construct & destruct - quick question - by El Forum - 06-29-2009, 08:48 AM
Construct & destruct - quick question - by El Forum - 06-29-2009, 08:54 AM



Theme © iAndrew 2016 - Forum software by © MyBB