Re: [SMARTY] suggestion: don't add any CRs in compiled template
| From: | Robert Amos | Date: | Wed, 24 Apr 2002 14:33:54 +0000 |
| Subject: | Re: [SMARTY] suggestion: don't add any CRs in compiled template | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-3867@lists.php.net to get a copy of this message | ||
I believe the issue is in the compiled template, before PHP has eaten the
newline.
If there is a newline after outputting of variables, then the lines in the
compiled template wouldn¹t match up with the lines in the original template
file, but that was never really a given anyway...
-bok
On 25/4/02 12:00 AM, Monte Ohrt banged a keyboard and produced the following
weird but readable email:
> Smarty inserts a newline after variables (and a few other cases) because
> PHP eats newlines after PHP tags. By adding a newline, you end up with
> the intended formatting of the template. The templates should render the
> same newlines that are in the original template.
>
> So, this template:
>
> {$foo1}
> {$foo2}
> {$foo3}{$foo4} {$foo5}
>
> {$foo6}
>
> Should render like this:
>
> foo1
> foo2
> foo3foo4 foo5
>
> foo6
>
> Can you give me an example of your template and its output that isn't right?
>
> Monte
>
>
>
>
> Daniil Kaltchenko wrote:
>> Hi,
>>
>> AZ> On Tue, 23 Apr 2002, Thies C. Arntzen wrote:
>>
>>>> it would be rather cool if smarty would not add any
>>>> "new-lines" to the compiled template. that way warnings and
>>>> errors generated by PHP would be way eaysier to spot in the
>>>> smarty template.
>>>> am i missing something?
>>>
>> AZ> I don't quite understand what you mean. "Add new-lines"?
>>
>> Andrei, after each {$var} in template, during compilation Smarty
>> insert in compiled template "\n" - New line. It is not very good,
>> because it can distort original tpl files (and design). In HTML, New
>> line can corrupt representation of this HTML. Can you fix it?
>>
>> Greeting,
>> Daniil
>>
>>
>
>