Ouzo\Injection\Injector::getInstance PHP Method

getInstance() public method

public getInstance ( $className, $name = '' )
    public function getInstance($className, $name = '')
    {
        $binder = $this->bindings->getBinder($className, $name);
        return $this->repository->getInstance($this->factory, $binder);
    }

Usage Example

示例#1
0
 public function __construct($name = null, array $data = array(), $dataName = '')
 {
     parent::__construct($name, $data, $dataName);
     $this->injectorConfig = new InjectorConfig();
     $this->frontControllerBindings($this->injectorConfig);
     $injector = new Injector($this->injectorConfig);
     $this->frontController = $injector->getInstance('\\Ouzo\\FrontController');
 }
All Usage Examples Of Ouzo\Injection\Injector::getInstance