has() 공개 메소드

Test if the container can provide something for the given name.
public has ( string $name ) : boolean
$name string Entry name or a class name.
리턴 boolean
예제 #1
0
파일: Router.php 프로젝트: offdev/router
 /**
  * @param string $controller
  *
  * @return GenericController
  */
 private function getControllerInstance(string $controller)
 {
     if ($this->container && $this->container->has($controller)) {
         $obj = $this->container->get($controller);
     }
     if (!isset($obj)) {
         $obj = new $controller();
         if ($this->container) {
             $this->container->injectOn($obj);
         }
     }
     return $obj;
 }
예제 #2
0
 public function offsetExists($id)
 {
     return parent::offsetExists($id) || $this->phpdi->has($id);
 }