Re: Incorrect newline counters
Monte Ohrt <[email protected]>
| Newsgroups | gmane.comp.php.smarty.devel |
|---|---|
| Message-ID | <[email protected]> |
I think this rule works: If a tag produces no output, then no newline
should be produced by it.
examples:
{$foo}
{$foo2}
{$foo3}
The above vars should make newlines in the resulting template since they
have output (even if it's empty).
{assign var="foo" value="bar"}
{assign var="foo2" value="bar2"}
{assign var="foo3" value="bar3"}
{if ...}
{/if}
{include ...}
The above functions should NOT make newlines in the resulting template,
there is no output. They are purely functional.
Dmitry Koteroff wrote:
>MO> I'd say in theory, any function on a line **by itself** that does not
>MO> produce output directly should not create a line in the output. So, #2
>MO> would probably be the expected output. Similar example:
>MO> {if $foo}
>MO> bar
>MO> {/if}
>MO> should output:
>MO> bar\n
>MO> and not:
>MO> \nbar\n\n
>Stop. It is identical to PHP's behaviour:
>
><?if (...) {?>
>bar
><?}?>
>
>Result is "bar\n".
>
>But you had said before that newlines MUST not be ignored after
>{...} constructions!
>
>Can you explain this? Maybe newlines must be always deleted after
>block-tags, but not after function-tag?
>
>Can you explain the FULL behavour of different tags?
>
>
>
--
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php