public function getControllerInstance($class, $namespace = '')
    {
        if (isset($this->complement['namespaces'])) {
            if (isset($this->complement['namespaces'][$namespace])) {
                $namespace = $this->complement['namespaces'][$namespace];

                $_class = $namespace . $class;

                if (class_exists($_class)) {
                    return call_user_func([$_class, 'getInstance']);
                }

                return false;
            }

            foreach ($this->complement['namespaces'] as $key => $namespace) {
                $instance = $namespace . $class;
                if (class_exists($instance)) {
                    return call_user_func([$instance, 'getInstance']);
                }
            }
        }

        return false;
    }
public function getControllerInstance($class, $namespace = '')
    {
        if (isset($this->complement['namespaces'])) {
            if (isset($this->complement['namespaces'][$namespace])) {
                $namespace = $this->complement['namespaces'][$namespace];

                $_class = $namespace . $class;

                if (class_exists($_class)) {
                    return call_user_func([$_class, 'getInstance']);
                }

                return false;
            }

            foreach ($this->complement['namespaces'] as $key => $namespace) {
                $instance = $namespace . $class;
                if (class_exists($instance)) {
                    return call_user_func([$instance, 'getInstance']);
                }
            }
        }

        return false;
    }
public function getControllerInstance ( $ class , $ namespace = '' ) { if ( isset ( $ this -> complement [ 'namespaces' ] ) ) { if ( isset ( $ this -> complement [ 'namespaces' ] [ $ namespace ] ) ) { $ namespace = $ this -> complement [ 'namespaces' ] [ $ namespace ] ; $ _class = $ namespace . $ class ; if ( class_exists ( $ _class ) ) { return call_user_func ( [ $ _class , 'getInstance' ] ) ; } return false ; } foreach ( $ this -> complement [ 'namespaces' ] as $ key => $ namespace ) { $ instance = $ namespace . $ class ; if ( class_exists ( $ instance ) ) { return call_user_func ( [ $ instance , 'getInstance' ] ) ; } } } return false ; }
Get complement controller instance.

@since 1.1.0

@param array $class     → class name
@param array $namespace → namespace index

@return object|false → class instance or false
Get complement controller instance .