[eluser]drewbee[/eluser]
headers with standard PHP header()
Quote:HTTP/1.x 200 OK
Date: Wed, 01 Apr 2009 17:56:02 GMT
Server: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8i DAV/2 FrontPage/5.0.2.2635 mod_bwlimited/1.4 mod_auth_passthrough/2.1
X-Powered-By: PHP/5.2.9
Expires: Wed, 1 Apr 2009 17:56:04 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Last-Modified: Wed, 01 Apr 2009 17:56:04 GMT
Transfer-Encoding: chunked
Content-Type: text/html
expires=Wed, 01-Apr-2009 19:56:04 GMT; path=/
Proxy-Connection: Keep-Alive
And with CI's header function
Quote:HTTP/1.x 200 OK
Date: Wed, 01 Apr 2009 18:01:36 GMT
Server: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8i DAV/2 FrontPage/5.0.2.2635 mod_bwlimited/1.4 mod_auth_passthrough/2.1
X-Powered-By: PHP/5.2.9
Transfer-Encoding: chunked
Content-Type: text/html
expires=Wed, 01-Apr-2009 20:01:36 GMT; path=/
Proxy-Connection: Keep-Alive
So this confirms my headers are not being set.
I just dug into the base Codeigniter.php file, and for some reason, call_user_func_array() cleans out the output class var. ????
Line 230-233
Code:
echo print_r($OUT);
// Call the requested method.
// Any URI segments present (besides the class/function) will be passed to the method for convenience
call_user_func_array(array(&$CI, $method), array_slice($URI->rsegments, 2));
Outputs:
Code:
CI_Output Object ( [final_output] => [cache_expiration] => 0 [headers] => Array ( [0] => Array ( [0] => Last-Modified: Wed, 1 Apr 2009 18:16:28 GMT [1] => 1 ) [1] => Array ( [0] => Expires: Wed, 1 Apr 2009 18:16:28 GMT [1] => 1 ) [2] => Array ( [0] => Cache-Control: no-store, no-cache, must-revalidate [1] => 1 ) [3] => Array ( [0] => Cache-Control: post-check=0, pre-check=0 [1] => ) [4] => Array ( [0] => Pragma: no-cache [1] => 1 ) ) [enable_profiler] => ) 1
But the following (moved print_r below the function call):
Code:
// Call the requested method.
// Any URI segments present (besides the class/function) will be passed to the method for convenience
call_user_func_array(array(&$CI, $method), array_slice($URI->rsegments, 2));
echo print_r($OUT);
Outputs : [empty string] The var is defined, as it doesn't throw any errors; Which makes me think $OUT->_display() doesn't get called. Yet none of my crap would show up if this was not true.
I am officially bewildered to no end.
My template draw() method...
Code:
function draw($data = null)
{
$data = array('data' => $data,
'page' => $this->page);
$this->CI->load->view('global_template', $data);
}
The only thing different I see going on here, is that the global template.php file is the one that calls $this->load->view() for all pages within itself. As a test, I simply loaded a base view from draw(). Same effect. I'm not missing some function call that I need to for final rendering of the output class am i? Using $this->CI->output->get_output(); from my template class I ended up with everything doubled.
WTF? lol.