Re: behavior of newlines following template tags

From: Date: Fri, 09 Feb 2001 08:04:12 +0000
Subject: Re: behavior of newlines following template tags
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-99@lists.php.net to get a copy of this message
How about this ? The first line {if $email}E-mail : {$email} {else}E-mail : Your e-mail address isn't given. {/if} The next line > -----Message d'origine----- > De : Joris Trooster [mailto:trooster@interstroom.nl] > Envoyé : vendredi 9 février 2001 08:53 > À : Smarty@lists.ispi.net > Objet : [smarty] Re: behavior of newlines following template tags > > > Yes, that's a good question.. Let's look at this backwards (from template > output to template code): > > The first line > E-mail: name@domain.com > The next line > > The first line > Your e-mail address isn't given. > The next line > > I should write a code like this, and expect the above output: > > The first line > {if $email} > E-mail: {$email} > {else} > Your e-mail address isn't given. > {/if} > The next line > > But what if we want to have some code that gives an output like this: > > The first line > E-mail: name@domain.com > The next line > > The first line > E-mail: Your e-mail address isn't given. > The next line > > I would (expect to) do something like this: > > The first line > E-mail: {if $email}{$email} > {else}Your e-mail address isn't given. > {/if} > The next line > > But that's not always practical, so maybe we can add a tag like {nocr} > > The first line > E-mail: {nocr} > {if $email} > {$email} > {else} > Your e-mail address isn't given. > {/if} > The next line > > In the examples the text between the {else}and{/if} should be > appear on the > same position as the text between {if}and{else}. > > Comments? > > Joris > > > --- > You are currently subscribed to smarty as: alain@nvision.lu > To unsubscribe send a blank email to $subst('Email.Unsub') > Visit Smarty's homepage at > http://www.phpinsider.com/php/code/Smarty/

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