Re: [SMARTY-DEV] newline after ?> in compiled templates
| From: | messju mohr | Date: | Fri, 25 Apr 2003 12:36:18 +0000 |
| Subject: | Re: [SMARTY-DEV] newline after ?> in compiled templates | ||
| References: | 1 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-1268@lists.php.net to get a copy of this message | ||
On Fri, Apr 25, 2003 at 01:33:37PM +0200, Wom.bat wrote:
> if I do a
>
> {$smarty.constant.FOO}bar
>
> the resulting output will be
>
> <?php echo @constant('FOO'); ?>
> bar
yes, but since php slurps newlines after ?>, the resulting output's
output, you won't become
FOO
bar
but
FOObar
> i.e. a newline is added after "?>"... this may lead to problems when using
> anything else than html (for example, plain text email templates), or if I
> want to replace this construct via an outputfilter (I do so for dynamically
> inserting a <meta http-equiv="refresh"...>)... I'd have to set the preg
> (in
> this case, I don't need one) to /s to include newlines
>
> As far as I can see that, Smarty always places a newline after a "?>"...
> maybe this should be fixed!? ;)
>
> (Smarty version is the current CVS)
>
> Regards,
> David
>
>
>
> --
> Smarty Development Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php