Jump to content

php class interaction


jambroo

Recommended Posts

Hello,

 

Im writing some code in PHP involving multiple classes and i need them to talk to eachother, however if i declare one and refer to it in one declared later i get an error. Im assuming the scope of the object must not reach inside that class.

 

So i was wondering what the most elegant way would be to refer to a class declared outside of the one that is being used. I have thought about passing the reference in the constructor but that looks a tad messy.

 

Thanks,

-Jamie

Link to comment
https://forums.phpfreaks.com/topic/80546-php-class-interaction/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.