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

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
JonathanT
New Member
New Member
Posts: 4
Joined: Tue May 04, 2010 9:15 am

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

Post 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
Post Reply

Return to “The Lounge”