comparison Page.inc @ 91:1d4c980f4255

Change the way headers are set. Disabled validation for non-html pages.
author Tom Fredrik "BFG" Klaussen <bfg@blenning.no>
date Thu, 18 Oct 2012 00:28:48 +0200
parents 7a9c45b53866
children 8aadd7a23b68
comparison
equal deleted inserted replaced
90:aafc23919e79 91:1d4c980f4255
16 function __construct($content = "") 16 function __construct($content = "")
17 { 17 {
18 $this->content = $content; 18 $this->content = $content;
19 } 19 }
20 20
21 function addHeader($txt) 21 function setHeader($headername, $value)
22 { 22 {
23 array_push($this->headers, $txt); 23 $this->headers[$headername] = $value;
24 } 24 }
25 25
26 function __toString() 26 function __toString()
27 { 27 {
28 return $this->content; 28 return $this->content;
158 } 158 }
159 159
160 function display() 160 function display()
161 { 161 {
162 $res = $this->genPage(); 162 $res = $this->genPage();
163 foreach ($res->headers as $header) { 163 foreach ($res->headers as $header => $value) {
164 header($header); 164 header("${header}: ${value}");
165 } 165 }
166 print $res; 166 print $res;
167 } 167 }
168 168
169 169