public function respondTo($func)
    {
        $route    = Router::currentRoute();
        $response = $func($route['extension'], $this);

        if ($response === null) {
            return $this->show404();
        }

        return $response;
    }
public function respondTo($func)
    {
        $route    = Router::currentRoute();
        $response = $func($route['extension'], $this);

        if ($response === null) {
            return $this->show404();
        }

        return $response;
    }
public function respondTo ( $ func ) { $ route = Router :: currentRoute ( ) ; $ response = $ func ( $ route [ 'extension' ] , $ this ) ; if ( $ response === null ) { return $ this -> show404 ( ) ; } return $ response ; }
Easily respond to different request formats.

@param callable $func

@return object
Easily respond to different request formats .