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