MyBB Community Forums

Full Version: Function variable to template
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So say I have this function
function Test()
{
a=1;
return a;
}

How do I retreive this value in template?
maybe you must store it in the language file..

and use

{$lang->your_var_name}
It would be easier to pollute the global namespace and do
function Test()
{
$GLOBAL['a']=1;
}

Then in the template you should be able to do {$a} and have it show right, depending on where the function is called.
It still doesn't show up in postbit.
Is it safe? I heard php in templates are not safe.
dunno about that