Welcome Guest, Not a member yet? Register   Sign In
Problem with views
#6

[eluser]gunter[/eluser]
interesting idea to use constructor and destructor to output the header and footer html... does it work if you echo your views like this?

Code:
echo      $this->load->view('footer',array(),TRUE);

another possibility is:



Processing Output

CodeIgniter has an output class that takes care of sending your final rendered data to the web browser automatically. More information on this can be found in the Views and Output class pages. In some cases, however, you might want to post-process the finalized data in some way and send it to the browser yourself. CodeIgniter permits you to add a function named _output() to your controller that will receive the finalized output data.

Important: If your controller contains a function named _output(), it will alwaysbe called by the output class instead of echoing the finalized data directly. The first parameter of the function will contain the finalized output.


that means you could use this:
Code:
function _output($output)
{
    echo      $this->load->view('header',array(),TRUE);
    echo $output;
    echo      $this->load->view('footer',array(),TRUE);
}

that means, instead of your con/destructor view loading you simply use this _output() method


Messages In This Thread
Problem with views - by El Forum - 08-07-2007, 03:59 PM
Problem with views - by El Forum - 08-07-2007, 04:04 PM
Problem with views - by El Forum - 08-07-2007, 08:30 PM
Problem with views - by El Forum - 08-08-2007, 02:44 AM
Problem with views - by El Forum - 08-08-2007, 09:49 AM
Problem with views - by El Forum - 08-08-2007, 09:58 AM
Problem with views - by El Forum - 08-08-2007, 10:11 AM
Problem with views - by El Forum - 08-08-2007, 01:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB