Re: Incorrect newline counters
Monte Ohrt <[email protected]>
| Newsgroups | gmane.comp.php.smarty.devel |
|---|---|
| Message-ID | <[email protected]> |
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)
--
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php