Re: [SMARTY] Smarty together with phpOpenTracker
| From: | Mark Rogers | Date: | Fri, 01 Apr 2005 14:01:58 +0000 |
| Subject: | Re: [SMARTY] Smarty together with phpOpenTracker | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-12384@lists.php.net to get a copy of this message | ||
Messju writes:
> most likely your "Smarty_Template.class.php" (which isn't from the
> smarty distribution) has a newline too much at it's end (at line
> 23). This newline (or any stuff outside of <?php .. ?>) is printed as
> soon as Smarty_Template.class.php gets included.
It's worth noting that you don't need to close the PHP tag at the end of a
document. It seems like good practise, but I presonally prefer to leave it
off to ensure that no whitespace gets included. (Whitespace, by definition,
isn't all that obvious to look at.)
Another common place to find whitespace is at the top of a document, eg a
space or blank line before the <?php.
NB: Having just posted (separately) to the effect that using ob_start() is
easiest, I agree with messju that the best option is to fix the problem,
although its worth also exploring output buffering for its other potential
benefits. Finding the problem won't be hard. The reason I said it might be
tricky was I'd got it into my head that it was probably due to an
interaction with phpOpenTracker which would be harder to find, but with
hindisght its probably much less complicated to solve.
Mark Rogers,
More Solutions Ltd