Re: newlines in files

From: Date: Thu, 25 Oct 2001 19:29:05 +0000
Subject: Re: newlines in files
References: 1 2 3 4  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-1728@lists.php.net to get a copy of this message
Andrei Zmievski wrote: > > On Thu, 25 Oct 2001, Monte Ohrt wrote: > > If your compiled template ends in a PHP function then you wouldn't have > > this problem, it would be eaten by PHP. So I suppose a workaround would > > be to put a dummy tag at the end of your template, like {$fooblah} :-) > > But if your template ends in plain text (as many templates do), you will > > get the newline introduced by text editors in your HTML code. Now Smarty > > ensures that the newline is removed in any event. > > > > Currently, when you do this: > > > > {include file="header.tpl"}blah{include file="footer.tpl"} > > > > If the contents of header.tpl ended in plain text, you would get a > > newline right before "blah". Now after this fix, it will run everything > > together, as you would expect a template to do. > > Except that you still don't get 1-to-1 correspondence between your > template and output, since you have to insert an extra newline if you > want to keep the previous one. > I think as far as templates go, this would be the intended behavior since the newline is added by the text editor, not by the template editing person themselves. I think this would be the intended behavior. -- Monte Ohrt <monte@ispi.net> http://www.ispi.net/

« previous php.smarty.general (#1728) next »