RE: [PHP] Re: template in message string

From: Date: Wed, 16 Apr 2003 15:05:42 +0000
Subject: RE: [PHP] Re: template in message string
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-144116@lists.php.net to get a copy of this message
sorry u didnt understand my question i worked it out $settings[lost_password_message] = preg_replace("/{(.+?)}/","$\\1",$settings[lost_password_message]); $username = "dan"; $pass = "test"; eval ("\$settings[lost_password_message] = \"$settings[lost_password_message]\";"); echo $settings[lost_password_message]; i can send variables back into the variable using eval and i change the {} var to a $ var before hand. i didnt see u mention phemplate , is it not good ?, and i can honestly say to start off i look at the smarty site and go ooooo, automatic confusing site. -----Original Message----- From: rush [mailto:pipa@rush.avalon.hr] Sent: Wednesday, April 16, 2003 11:32 PM To: php-general@lists.php.net Subject: [PHP] Re: template in message string "Dan Rossi" <daniel@electroteque.org> wrote in message news:EJECKPELDLGDPHHJOEDLMEFMEJAA.daniel@electroteque.org... > hi guys i am trying to setup predefined messages which will contain > variables than need to go through it for instance > > Hello {username} you have changed your pass to {pass} this is the message > setup in my settings,ini file which i extract using parse_ini_file , i > basically need to find a way to convert both ther {username} and {pass} and > send the variables of the same name to the string for instance > > $username = "dan" > $pass = "dan" pick any template engine/system, fasttemplate, Smarty, TemplateTamer, to name a few. rush -- http://www.templatetamer.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#144116) next »