Beispiel #1
0
 protected function bind($interfacesPath)
 {
     $interfaces = (require $interfacesPath . '.php');
     foreach ($interfaces as $interface => &$class) {
         \Scoop\IoC\Injector::bind($interface, $class);
     }
     return $this;
 }
Beispiel #2
0
 public function intercept($url)
 {
     $matches = $this->filterProxy($url);
     if ($matches) {
         foreach ($matches as &$route) {
             if (isset($route['proxy'])) {
                 $proxy = explode(':', $route['proxy']);
                 $method = array_pop($proxy);
                 $proxy = array_shift($proxy);
                 $proxy = \Scoop\IoC\Injector::getInstance($proxy);
                 $proxy->{$method}();
             }
         }
     }
 }
Beispiel #3
0
 /**
  * Obtiene la instancia del controlador ligado a la ruta.
  * @param string $className Nombre del controlador a obtener.
  * @return Controller Controlador a obtener.
  */
 protected function inject($className)
 {
     return \Scoop\IoC\Injector::getInstance($className);
 }