summaryrefslogtreecommitdiff
path: root/it_html.class
diff options
context:
space:
mode:
authorChristian Schneider2014-03-04 16:45:10 +0100
committerChristian Schneider2014-03-04 16:45:10 +0100
commit2e40c7f77ee66f83586cbd7c2b5d90cadd93144f (patch)
treeb89b482a262dbe766e8da12dd466f440f67309e1 /it_html.class
parent65a717a0273a9173c0bd0151ecc7caee152756ba (diff)
downloaditools-2e40c7f77ee66f83586cbd7c2b5d90cadd93144f.tar.gz
itools-2e40c7f77ee66f83586cbd7c2b5d90cadd93144f.tar.bz2
itools-2e40c7f77ee66f83586cbd7c2b5d90cadd93144f.zip
Added headers parameter to it_html (e.g. for Vary header)
Diffstat (limited to 'it_html.class')
-rw-r--r--it_html.class5
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');