diff options
-rw-r--r-- | it_html.class | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/it_html.class b/it_html.class index fbab0db..c69e10d 100644 --- a/it_html.class +++ b/it_html.class @@ -167,6 +167,7 @@ function html($args) * * @param args... any number of assoc arrays and strings. strings will be content of <head> * @param $p['content-type'] content type (default: "text/html; charset=iso-8859-1") + * @param $p['headers'] Array of HTTP headers (e.g. [ 'Vary' => "User-Agent,Accept-Language" ]) * @param $p['cssinline'] stylesheet to be put in header * @param $p['description'] data for <meta name="description"> tag * @param $p['keywords'] data for <meta name="keywords"> tag @@ -209,7 +210,11 @@ function head($args = array()) if($this->p['htmltype'] == "xhtml-mobile" && strpos($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator')) header("Content-Type: application/xhtml+xml; charset={$this->p['charset']}"); # for validation else if (!headers_sent()) # prevent warnings when ED() in use + { header("Content-Type: " . $p['content-type']); + foreach ((array)$p['headers'] as $key => $value) + header("$key: $value"); + } $js = isset($p['jsenv']) ? "var env = " . itjs::serialize($p['jsenv']) . ";\n" : ''; $js .= $this->_itjs($p['jsinline'], 'inline'); |