| 
 Posted by windandwaves on 11/17/06 02:15 
Michael Fesser wrote: 
> .oO(windandwaves) 
> 
> >I have a class from which I create an object.  I want this object to be 
> >available in all my functions for my application. Basically, I want to 
> >make the object global.  What is the best way to do this? 
> 
> You could search for "singleton". 
> 
> Micha 
 
Thanks Micha 
 
That is really cool.  I was just reading about static and this is a 
great way to use it.  Thanks a million for the recommendation.  Cool 
stuff.  What would actually be ideal is if there were a function like 
global that you could use when creating an object, which would make the 
object global without having to do this singleton stuff.  It would 
actually make sense if the global $myobj just did this if it were used 
outside of a function. 
 
Thanks 
 
Nicolaas
 
  
Navigation:
[Reply to this message] 
 |