Re: AW: [SMARTY] suggestion: don't add any CRs in compiled template
| From: | Monte Ohrt | Date: | Wed, 24 Apr 2002 16:54:39 +0000 |
| Subject: | Re: AW: [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-3873@lists.php.net to get a copy of this message | ||
Werner,
I'm not seeing this same problem. Could you try the CVS version and see if you get the same results?
Monte
Werner Schweizer wrote:
I found that smarty 2.0.1 eats a space or newline character if a variable is followed by regular text: Text1 {$var1} text2 Text3 {$var2} Text4 output as Text1 var1text2 Text3 var2Text4 Werner-- Monte Ohrt <monte@ispi.net> Director of Technology, ispi Inc.-----Ursprüngliche Nachricht----- Von: Monte Ohrt [mailto:monte@ispi.net] Gesendet: Mittwoch, 24. April 2002 16:50 An: Robert Amos Cc: smarty-general@lists.php.net Betreff: Re: [SMARTY] suggestion: don't add any CRs in compiled template That is right, the newlines in the compiled template wouldn't end up the same as the original template. However, when you execute this compiled template, the _output_ should be the same as the original template. PHP eats carriage returns after PHP tags, so adding them is a must to get the output to come out as expected. Try a simple test, make a template with different variables in it. Don't worry about the compiled version, just see if the output results are what you would expect. The only problem I'm aware of is smarty comments on a line by themselves. Monte Robert Amos wrote:I believe the issue is in the compiled template, before PHPhas eatenthe newline. If there is a newline after outputting of variables, thenthe lines inthe compiled template wouldn¹t match up with the lines inthe originaltemplate 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:newline, you endSmarty inserts a newline after variables (and a few other cases) because PHP eats newlines after PHP tags. By adding atemplates shouldup with the intended formatting of the template. Thethat isn'trender 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"new-lines" toright? 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 anyHTML, NewAZ> 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). Inthe compiled template. that way warnings and errors generated by PHP would be way eaysier to spot in the smarty template. am i missing something?-- Monte Ohrt <monte@ispi.net> Director of Technology, ispi Inc. -- Smarty General Mailing List (http://smarty.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpline can corrupt representation of this HTML. Can you fix it? Greeting, Daniil