Re: [SMARTY-DEV] Smarty outputting headers when using fetch()
| From: | Monte Ohrt | Date: | Fri, 06 Dec 2002 15:36:45 +0000 |
| Subject: | Re: [SMARTY-DEV] Smarty outputting headers when using fetch() | ||
| References: | 1 2 3 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-381@lists.php.net to get a copy of this message | ||
hehe yes I know :-) and there is a reason it is done this way. fetch()
uses output buffering, whereas display() does not. This way display()
goes as fast as possible outputting the content as it goes, no buffering
involved.
Monte
On Fri, 2002-12-06 at 09:25, Ivo Jansch wrote:
> Hi,
>
> Monte Ohrt wrote:
>
> > Hmm, looking at the code, it doesn't look like headers should get sent
> > if you are using fetch(), it should skip the cache_modified_check
> > section.
>
> Hmm, I had overlooked that. That's a pity though. The information that a
> file has not changed is of interest even if I use fetch.
>
> The reason I overlooked it by the way, is that the way display() and
> fetch() work as not quite 'clean' code.
>
> Consider for example the difference between (pseudocode):
>
> function display()
> {
> $result = $this->fetch();
> echo $result;
> }
>
> and
>
> function display()
> {
> $this->fetch(display=$true);
> }
>
> Smarty uses the latter, and this causes the fetch function to be clouded
> with display related stuff. The first approach is a cleaner design if
> you ask me.
>
> Greetings,
> Ivo
>
> --
> Ivo Jansch <ivo@ibuildings.nl>
> ibuildings.nl BV - information technology
> http://www.ibuildings.nl
--
Monte Ohrt <monte@ispi.net>