Jump to content

Variable class name, static method


ignus

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/166743-variable-class-name-static-method/
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.