Hi guys,

How would one get a $var from a function used in a module.

Lets say the googtube module. It uses a var which i would like to print in page.tpl... I have tried almost everything i can think of.

Comments

nevets’s picture

Unless the function exposes the variable in someway you can not access the variable outside the function. In general terms a function can exposed the value by a) returning the value, b) being passed a variable by reference, c) declaring the variable global (highly discouraged)

Michsk’s picture

i tried returning it did not work. found a work around tough without having to send the var. Thanks for you time to comment