View Single Post
Old 01-06-2009, 02:48 AM   #10 (permalink)
Wildhoney
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

I see. Well, just use my original code and set that to $pApp like so:

php Code:
$pApp = TalkPHP_Factory::getInstance();

If you do that in a file that is loaded towards the beginning of the execution, then $pApp will be accessible from most places throughout your applications. You could make it a global, but I'm not too fond of that. Outside of classes and functions, it will work perfectly well like so, even when in different files:

php Code:
echo $pApp->TalkPHP_Goodbye()->getText();
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote