Hi
Need some help with assigning one variable to another.
{assign var=AnyVariable value= Withmind}
{assign var=$AnyVariable value= $Withmind}
This is what I've tried but both fail.
Also tried $1 = $2
Can someone give me a working formula to transfer one variable to another. Does smarty come in somewhere.
Would like to put the code into UDT if poss.
A bit thick on this subject.
Thanks
Assign a variable
Re: Assign a variable
Don't forget the scope parameter, examples: http://www.cmscanbesimple.org/blog/smar ... e-examples
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Re: Assign a variable
Code: Select all
{assign var=AnyVariable value= Withmind}
{assign var=$AnyVariable value= $Withmind}
try:
{assign var=AnyVariable value=$Withmind}
or short:
{$AnyVariable=$Withmind}
Re: Assign a variable
Hi
Thanks for your suggestions but still unable to get it working.
{assign var=AnyVariable value=$Withmind}
or short:
{$AnyVariable=$Withmind}
Trying your suggestions,
the var shows error T_Var and the other one errors with Evali.
Below is what I have tried and does not error but the result not correct.
$smarty->assign('temp' , $temp1);
I am trying just to copy one var to the other and this within a UDT and then just call the UDT in template.
No luck, it seems an easy thing to try but the formula is not correct.
Any further help would be appreciated.
Thanks for your suggestions but still unable to get it working.
{assign var=AnyVariable value=$Withmind}
or short:
{$AnyVariable=$Withmind}
Trying your suggestions,
the var shows error T_Var and the other one errors with Evali.
Below is what I have tried and does not error but the result not correct.
$smarty->assign('temp' , $temp1);
I am trying just to copy one var to the other and this within a UDT and then just call the UDT in template.
No luck, it seems an easy thing to try but the formula is not correct.
Any further help would be appreciated.
Re: Assign a variable
You probably should post your whole template.
What is the UDT for? to do the assignment or something else?
What is the UDT for? to do the assignment or something else?