protected function createController($controller)
    {
        if (false === strpos($controller, '::')) {
            throw new \InvalidArgumentException(sprintf('Unable to find controller "%s".', $controller));
        }

        list($class, $method) = explode('::', $controller, 2);

        if ($this->container->has($class)) {
            $controller = $this->container->get($class);
        } else {
            if ( ! class_exists($class)) {
                throw new \InvalidArgumentException(sprintf('Class "%s" does not exist.', $class));
            }

            $controller = new $class();
        }

        if ($controller instanceof ContainerAwareInterface) {
            $controller->setContainer($this->container);
        }

        return array($controller, $method);
    }
protected function createController($controller)
    {
        if (false === strpos($controller, '::')) {
            throw new \InvalidArgumentException(sprintf('Unable to find controller "%s".', $controller));
        }

        list($class, $method) = explode('::', $controller, 2);

        if ($this->container->has($class)) {
            $controller = $this->container->get($class);
        } else {
            if ( ! class_exists($class)) {
                throw new \InvalidArgumentException(sprintf('Class "%s" does not exist.', $class));
            }

            $controller = new $class();
        }

        if ($controller instanceof ContainerAwareInterface) {
            $controller->setContainer($this->container);
        }

        return array($controller, $method);
    }
protected function createController ( $ controller ) { if ( false === strpos ( $ controller , '::' ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Unable to find controller "%s".' , $ controller ) ) ; } list ( $ class , $ method ) = explode ( '::' , $ controller , 2 ) ; if ( $ this -> container -> has ( $ class ) ) { $ controller = $ this -> container -> get ( $ class ) ; } else { if ( ! class_exists ( $ class ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Class "%s" does not exist.' , $ class ) ) ; } $ controller = new $ class ( ) ; } if ( $ controller instanceof ContainerAwareInterface ) { $ controller -> setContainer ( $ this -> container ) ; } return array ( $ controller , $ method ) ; }
Creates the callable from the controller string

@param  string $controller
@return callable
Creates the callable from the controller string