New version submitted by TomB
[carbonphp.git] / Documentation / libraries / output.html
blob99252a3d4a8b206d8ed370caa172b1faa001a8e3
1 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
2 <head>
3 <title>CarbonPHP Documentation</title>
4 <style type="text/css">
5 * {
6 margin: 0;
7 padding: 0;
10 html {
11 font-family: "Lucida Sans Unicode", "Lucida Grande";
12 font-size: 12px;
15 body {
16 background: #fff;
17 color: #666;
20 h1 {
21 font-size: 15px;
22 font-weight: bold;
23 margin: 0 0 5px 0;
26 h2 {
27 font-size: 13px;
28 font-weight: bold;
29 margin: 5px 0 5px 0;
32 ol, ul {
33 margin: 10px 0 10px 0;
34 list-style-position: inside;
37 p {
38 margin: 5px 0 5px 0;
41 .content {
42 border: 1px dotted #444;
43 margin: 10px;
44 padding: 10px;
45 text-align: justify;
46 width: 700px;
49 .example {
50 border: 1px solid #ccc;
51 background: #eee;
52 margin: 10px;
53 padding: 10px;
55 </style>
56 </head>
58 <body>
59 <div class="content">
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>
68 </div>
70 <div class="content">
71 <h1>$this->output->set_final_output()</h1>
73 <p>This lets you set the final output string.</p>
75 <div class="example">
76 $this->output->set_final_output($data);
77 </div>
79 <p><i>Note</i>: if you do manually set your output it must be the last thing done when you call it.</p>
80 </div>
82 <div class="content">
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>
87 <div class="example">
88 $data = $this->output->get_final_output();
89 </div>
91 <p><i>Note</i>: data will only be available from this method only if the data has previously been sent to
92 the browser.</p>
93 </div>
95 <div class="content">
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');
107 </div>
108 </div>
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);
118 </div>
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);
124 </div>
125 </div>
126 </body>
128 </html>