Welcome Guest, Not a member yet? Register   Sign In
Pass a variable of a controller to another controller
#10

[eluser]CroNiX[/eluser]
CI uses buffered output when using the loader class and other things.

So when you directly echo from a controller, that output gets sent out before the rest of the page which includes the headers. Obviously, headers need to be sent before any other output.

You can always use the output class in your controller to append the content that you were echoing to the buffer.

Code:
$this->output->append_output('<div>some extra thing</div>');

However, generally there should be NO HTML in a controller. That belongs in a view. If you follow how CI is meant to be used you will have fewer problems.

Controllers should really only gather the information needed from models/libraries/etc to generate the view.


Messages In This Thread
Pass a variable of a controller to another controller - by El Forum - 11-07-2012, 01:18 PM
Pass a variable of a controller to another controller - by El Forum - 11-07-2012, 07:59 PM
Pass a variable of a controller to another controller - by El Forum - 11-08-2012, 05:22 AM
Pass a variable of a controller to another controller - by El Forum - 11-08-2012, 06:25 AM
Pass a variable of a controller to another controller - by El Forum - 11-08-2012, 06:28 AM
Pass a variable of a controller to another controller - by El Forum - 11-08-2012, 06:51 AM
Pass a variable of a controller to another controller - by El Forum - 11-08-2012, 08:59 AM
Pass a variable of a controller to another controller - by El Forum - 11-08-2012, 09:47 AM
Pass a variable of a controller to another controller - by El Forum - 11-08-2012, 10:01 AM
Pass a variable of a controller to another controller - by El Forum - 11-08-2012, 10:11 AM
Pass a variable of a controller to another controller - by El Forum - 11-08-2012, 10:39 AM
Pass a variable of a controller to another controller - by El Forum - 11-08-2012, 11:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB