Page 1 of 1

Problems making an Object available over more than one UDT - PLEASE ADVISE

Posted: Thu May 27, 2010 1:07 pm
by JonathanT
Hello all,

Thanks to anyone who maybe be willing to help in advance.

Running the latest version of CMS MS. I created my self a nice php banner swapping script. The problem is, when I require this script in a UDT then call create the Object. The constructor works fine, which is placed in the header. So for referance 

UDT 1:

require('banner_swap/index.php');

$banner = new banner_Swap();


This works fine. Hoorah.

However when I create a second UDT containing:

$banner->write_Banner();

- I get the error, call to a member function on a non object.

I think this is a scope issue.

I have also tried the global $banner etc etc. and calling the require in both templates.

If anybody knows, please share your wisdow! Thank you. I hope you can help.


Regards,

            Jonathan