Re: [SMARTY] How to change HTTP headers

Ivo Jansch <[email protected]>
Newsgroups gmane.comp.php.smarty.general
Message-ID <[email protected]>
Hi,

thomas Armstrong wrote:

> But when analyzing my HTTP headers, I get:
> --------
> * Content-Type = text/html; charset=ISO-8859-1
> --------
> What am I doing wrong? Thank you very much.

The problem is that your function is executed only during the initial
rendering of the page. When the page is cached, your function is no
longer executed, and the header no longer output.

If you want to change the headers, it's better not to put them in your
template, but before your call to smarty->fetch, like so:

<?php

  ....
  header("Content-type: text/html; charset=utf-8");
  $smarty->display("index.tpl");

?>

There's not much reason to put the header inside the template, neither
from a template designer perspective nor functionality wise, I think.

Greetings,
Ivo

-- 
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.