Re: [SMARTY] Need help with modifiers

From: Date: Thu, 17 Apr 2003 15:34:15 +0000
Subject: Re: [SMARTY] Need help with modifiers
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-9296@lists.php.net to get a copy of this message
On Thu, Apr 17, 2003 at 04:51:40PM +0200, Alexander Feil wrote: > Hi There! > > I'm trying to get this expression work: > > > {$nachricht|replace:"#name":$sms[sms].name|replace:"#datum":$event.datum|dat > e_format:'%d.%m.%Y'|replace:"#ort":$event.ort} > > especially this doesn't work: > |replace:"#datum":$event.datum|date_format:'%d.%m.%Y' i think the problem is: you cannot have brackets in modifiers so you cannot force operator-precedence in chained modifiers. they are always applied from lefto to right. you want to do modify $event.datum with |date_format, but you modify $nachricht with it. try sth. like: {assign var=tmp_datum value=$event.datum|date_format:'%d.%m.%Y'} {$nachricht|replace:"#name":$sms[sms].name|replace:"#datum":$tmp_datum|replace:"#ort":$event.ort} HTH > Can anybody help?? > > Greets from Germany, me2 :) > Alexander Feil

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