Re: [SMARTY] Accessing Assigned Variables

From: Date: Fri, 31 Jan 2003 20:14:23 +0000
Subject: Re: [SMARTY] Accessing Assigned Variables
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-7443@lists.php.net to get a copy of this message
I think you misunderstand what I want to do. there is no '$var1' in my PHP. If you read closely, I assigned like this: $smarty->assign("var1","data"); Just to make sure I wasn't on drugs, I tried what you said and of course, got back: Notice: Undefined variable: var1 in xxx.php on line xxx As I mentioned, I can do this by accessing $smarty->_tpl_vars['var1'] but I thought there was a cleaner way. Ferdinand Beyer wrote:
On 31 Jan 2003 at 12:43, Darryl Bleau wrote:
I know I saw this in the mailing list someplace, but I can't find it. (It would be nice if the mailing list archive were searchable! :) ).
Sometimes a quick look into the manual does the trick :-)
in my php: $smarty->assign("var1","data"); then later, I want to do something like this: if ($smarty.variables.var1 == "data") ... possible?
Of course. But why do you want to use $smarty.variables.var1 if you could simply use $var1? if ($var1 == "data") or if ($var1 eq "data") I don't want to be rude but why don't you guys read the quick start guide and the manual before posting questions to the mailing list?


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