FuseLogic - Lite version of Dependency Injection


/ Published in: PHP
Save to your folder(s)

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.