1 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en">
3 <title>CarbonPHP Documentation
</title>
4 <style type=
"text/css">
11 font-family: "Lucida Sans Unicode", "Lucida Grande";
33 margin: 10px 0 10px 0;
34 list-style-position: inside
;
42 border: 1px dotted
#444;
50 border: 1px solid
#ccc;
60 <h1>Output Library
</h1>
62 <p>The output library is a small class used to send the finalised web page to the browser. It is also
63 responsible for caching.
</p>
65 <p><i>Note
</i>: this library is loaded automatically by CarbonPHP.
</p>
67 <p>Normally you will not notice or interact with the output class.
</p>
71 <h1>$this-
>output-
>set_final_output()
</h1>
73 <p>This lets you set the final output string.
</p>
76 $this-
>output-
>set_final_output($data);
79 <p><i>Note
</i>: if you do manually set your output it must be the last thing done when you call it.
</p>
83 <h1>$this-
>output-
>get_final_output()
</h1>
85 <p>This lets you manually get the data as a string that will be sent to the browser.
</p>
88 $data = $this-
>output-
>get_final_output();
91 <p><i>Note
</i>: data will only be available from this method only if the data has previously been sent to
96 <h1>$this-
>output-
>set_header_data()
</h1>
98 <p>This lets you manually set any server headers, which the output class will send for you.
</p>
100 <div class=
"example">
101 $this-
>output-
>set_header_data('HTTP/
1.0 200 OK');
<br />
102 $this-
>output-
>set_header_data('HTTP/
1.1 200 OK');
<br />
103 $this-
>output-
>set_header_data('Last-modified: ' . gmdate('D, d M Y H:i:s', $last_update) . 'GMT');
<br />
104 $this-
>output-
>set_header_data('Cache-Control: no-store, no-cache, must-revalidate');
<br />
105 $this-
>output-
>set_header_data('Cache-Control: post-check=
0, pre-check=
0, false);
<br />
106 $this-
>output-
>set_header_data('Pragma: no-cache');
110 <div class=
"content">
111 <h1>$this-
>output-
>enable_profiler()
</h1>
113 <p>This method allows you to enable or disable the Profiler, which will display benchmark and other data at the
114 bottom of your pages for debuggign and optimisation purposes.
</p>
116 <div class=
"example">
117 $this-
>output-
>enable_profiler(true);
120 <p>This will enable profiling, and a report will be generated and displayed at the bottom of your pages.
</p>
122 <div class=
"example">
123 $this-
>output-
>enable_profiler(false);