Re: [Phplib-users] inside functions
Brought to you by:
nhruby,
richardarcher
|
From: Mike G. <Mik...@sa...> - 2002-05-22 11:06:33
|
The $t needs to be in a global inside the function. E.g.
include('template.inc');
$t = new Template('./templates');
function test() {
global $t;
$t->set_var("REPLACE","SOMETHING");
}
Cheers!
Mike Green
Quadratini wrote:
> include "template.inc"
>
> .....
> .....
>
> function test()
> {
> $t->set_var("REPLACE","SOMETHING");
>
> }
>
> .......
> .......
>
> why wouldn't it work?
> It works if it's outside the function. But if it's INSIDE the function,
> it won't work. Help me please ?
|