I am using Bucket DIC for injection and unit testing.
In most cases, this type of code works fine:
$model_obj = $dic->get('ThatModel')
But I can’t figure out how to use DIC in a case where the constructor has arguments:
class OtherModel {
function __construct($param1,$param2) {
}
}
The same DIC code doesn’t work.
Are there other containers which solve this problem?
By attaching a factory to your container, you can control with which arguments the controller is invoked: