Re: [SMARTY] Avoid unnecessary whitespace in compiled templates?
| From: | Monte Ohrt | Date: | Mon, 03 Feb 2003 20:39:10 +0000 |
| Subject: | Re: [SMARTY] Avoid unnecessary whitespace in compiled templates? | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-7496@lists.php.net to get a copy of this message | ||
They should have a new line after ?> PHP eats them.
On Mon, 2003-02-03 at 14:29, Lars Noschinski wrote:
> sweatjejm@mchsi.com writes:
> >> But shouldn't this be covered by output-buffering?
> >
> > It would, except I think your output buffering was in the wrong place.
> > e.g.
> > <?php
> > include 'file_with_trailing_space.php';
> > ..
> > ob_start();
> > $t->display();
> > ..
> >
> > instead of
> > <?php
> > ob_start();
> > include 'file_with_trailing_space.php';
> > ..
> > $t->display();...
>
> No, I tried it once again with ob_start() being the first command
> after the "<?php" which starts at the first char in the file.
>
> I tried also
>
> <?php
> ob_start();
> $tmp = $smarty_fetch($page);
> header("Location: http://localhost");
> ob_end_flush();
> ?>
>
> and this leads to the same error. So it seems that
>
> > think you can configure PHP to enable output buffering by default in
> > the PHP.ini file.
>
> Not an option, as I don't have this possibility on this server.
>
> BTW: After a 'cvs update' all smarty php-files had an newline after the
> "?>".
>
> Version info: It's PHP 4.2.3 with the newest CVS smarty.
--
Monte Ohrt <monte@ispi.net>