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

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
eh
Forum Members
Forum Members
Posts: 29
Joined: Sun Oct 07, 2007 1:19 pm

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

Post 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
Last edited by eh on Mon May 05, 2008 11:33 pm, edited 1 time in total.
alby

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

Post 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
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm

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

Post 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
eh
Forum Members
Forum Members
Posts: 29
Joined: Sun Oct 07, 2007 1:19 pm

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

Post by eh »

Thank you.
Post Reply

Return to “CMSMS Core”