/ Published in: PHP
Very usefull lite dependency injection for PHP5.
Usage:
di exends fuselogic_container()
{
function __construct()
{
parant::__construct(__FILE__);
}
}
safe this to the folder with others class with name "class.class_name.php'
then you can do like bellow
$di = new di();
$c1 = $di->class_x; //singleton
$c2 = $di->class_x; //singleton
$c3 = $di->class_x(); //not singleton
Usage:
di exends fuselogic_container()
{
function __construct()
{
parant::__construct(__FILE__);
}
}
safe this to the folder with others class with name "class.class_name.php'
then you can do like bellow
$di = new di();
$c1 = $di->class_x; //singleton
$c2 = $di->class_x; //singleton
$c3 = $di->class_x(); //not singleton