ignus Posted July 21, 2009 Share Posted July 21, 2009 I apologize if the title is not exactly accurate, but my head just goes nuts when I try to think how would I name what I want to do, as a programmer, its always easier with code: $dataMapper = $yay . "_something"; $dataMapper::getInstance(); //this is want I want to do, but is not valid The classes I want to load are all singleton. I know it may be easier to implement something like a Registry but I want to do it this way (plus, I dont have that many different class names, so maybe it's not worth it) Thanks for the help Quote Link to comment Share on other sites More sharing options...
btherl Posted July 21, 2009 Share Posted July 21, 2009 I believe php 5.3.0 and greater can do this. Otherwise you'll have to kludge it somehow, perhaps with a lookup table mapping names to class instances. http://www.php.net/manual/en/language.oop5.paamayim-nekudotayim.php Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.