Re: [SMARTY-DEV] Incorrect newline counters
| From: | Monte Ohrt | Date: | Tue, 01 Jun 2004 17:01:35 +0000 |
| Subject: | Re: [SMARTY-DEV] Incorrect newline counters | ||
| References: | 1 2 3 4 5 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-2359@lists.php.net to get a copy of this message | ||
Dmitry Koteroff wrote:
I have a little question. Let's consider piece of code
(t_controller does not modify or trim its body):
{t_controller src="Orphus_Test" name="date" format="Y-m-d"}
{$date}
{/t_controller}
<hr>
Please say which result should it THEORETICALLY output?
1. "2004-06-01\n\n<hr>"
or
2. "2004-06-01\n<hr>"
Which one?
I'd say in theory, any function on a line **by itself** that does not produce output directly should not create a line in the output. So, #2 would probably be the expected output. Similar example:
{if $foo}
bar
{/if}
should output:
bar\n
and not:
\nbar\n\n
Now, one problem (known) with Smarty output is comment fields.
{* this is a comment *}
This will create a newline in the output, which it really shouldn't. This was never completely fixed (AFAIK)