I'm looking for a way to load classes into PHP without using hardwired names.
The idea is the script will load a text file with names of 'components'(classes), then load them by the names in the file. For example:
<xml><Classes><class name="myClass"/></Classes></xml>
When the PHP is run, it would need to do something like this:
require_once {myClass}".class.php";
var myclass = new {myClass}();
require_once $class . ".class.php";
$myclass = new $class;
See http://www.php.net/manual/en/language.oop5.basic.php#language.oop5.basic.new.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With