Page 1 of 1

$smarty.get.myvar - doesn't return variable contents [SOLVED]

Posted: Mon May 05, 2008 8:06 pm
by eh
Hi
Searched in the forum but didn't find any answer.

See many examples where $smarty.get.var_name is used, but won't work with my installation (CMSMS 1.2.4, WinXP, apache).

Did this in a global content block:

Code: Select all

{assign var=testx value='test'}
{assign var=testy value=$smarty.get.testx}
{$testy}
But nothing gets displayed.

Then did this:

Code: Select all

{assign var=testx value='test'}

{if isset($smarty.get.testx)}
   IS SET
{else}
   NOT SET
{/if}
Always get "NOT SET".

Have no idea what could be wrong.

Thanks for any help!
Ernst

Re: $smarty.get.myvar - doesn't return variable contents

Posted: Mon May 05, 2008 9:19 pm
by alby
eh wrote: See many examples where $smarty.get.var_name is used, but won't work with my installation (CMSMS 1.2.4, WinXP, apache).
Your examples are wrong.
$smarty.get.var_name is the variable in query url:
www.foo.bar/index.php?page=alby&[b]var_name[/b]=my

Alby

Re: $smarty.get.myvar - doesn't return variable contents

Posted: Mon May 05, 2008 9:25 pm
by Nullig
To do what you're trying to do, I believe it would be:

{assign var=testx value='test'}
{assign var=testy value=$testx}
{$testy}

which doesn't use the $smarty.get.var_name function.

If you were trying to capture a variable from a URL, like:

http://mywesite.com/index.php?page=mypage&testx=test

then $smarty.get.textx would return "test".

Nullig

Re: $smarty.get.myvar - doesn't return variable contents [SOLVED]

Posted: Mon May 05, 2008 11:33 pm
by eh
Thank you.