public function addController($uriPattern, callable $controller, $method='', $contentType='')
    {
        $routeBuilder = new RouteBuilder();
        $routeBuilder
            ->addUriPattern($uriPattern)
            ->addController($controller, $this->getAppController())
            ->addMethod($method)
            ->addContentType($contentType);

        $route = $routeBuilder->getRoute();
        $this->getRouter()->addRoute($route);
        return $route;
    }
public function addController($uriPattern, callable $controller, $method='', $contentType='')
    {
        $routeBuilder = new RouteBuilder();
        $routeBuilder
            ->addUriPattern($uriPattern)
            ->addController($controller, $this->getAppController())
            ->addMethod($method)
            ->addContentType($contentType);

        $route = $routeBuilder->getRoute();
        $this->getRouter()->addRoute($route);
        return $route;
    }
public function addController ( $ uriPattern , callable $ controller , $ method = '' , $ contentType = '' ) { $ routeBuilder = new RouteBuilder ( ) ; $ routeBuilder -> addUriPattern ( $ uriPattern ) -> addController ( $ controller , $ this -> getAppController ( ) ) -> addMethod ( $ method ) -> addContentType ( $ contentType ) ; $ route = $ routeBuilder -> getRoute ( ) ; $ this -> getRouter ( ) -> addRoute ( $ route ) ; return $ route ; }
Adds a controller to the list of observed controllers.

@param string $uriPattern
@param callable $controller
@param string $method
@param string $contentType
@return \Puppy\Route\Route
Adds a controller to the list of observed controllers .