/** * Check whether current request is rest * * @static * @access public * @return bool */ public static function is_rest() { $pattern = static::$pattern; $extension = Input::extension(); // Check if a file extension is used return preg_match($pattern, $extension, $matches) or '' != static::detect_format(); }