PDA

View Full Version : ok - im confused...


Ee-Ore
09-12-2008, 09:43 PM
I've created a plugin the same way as I create any other.

For the purposes of this test - I have given it the following code...

$leonvar = "Testing 123"; and activated upon global_start

If I insert $leonvar into my navbit template - it prints our as expected.

However if I insert it into my forumhome_forumbit_level2_post template - I get nothing !

Baffled.

Any ideas ?

Thanks, Leon

Guest190829
09-12-2008, 09:46 PM
This is an issue with variable scope. If the forumhome_forumbit_level2_post template is generated with a local context (say a function or a method), your variable will not have scope within that function and so nothing will be generated.

Ee-Ore
09-12-2008, 09:48 PM
Thanks for the prompt reply Danny.

Any suggestion on where I start going to look for the solution ?

Thanks.

EDIT...

$GLOBALS[] will work - but is it the best method ?

Opserty
09-13-2008, 02:32 PM
Its probably the easiest way to get around the issue, yes.