public static function format()
    {
        $format = null;

        if (count(self::accept('format')) == 1) {
            $mime = explode('/', key(self::accept('format')));
            $format = $mime[1];

            if ($pos = strpos($format, '+')) {
                $format = substr($format, 0, $pos);
            }

            //Format cannot be *
            if ($format == '*') {
                $format = null;
            }
        }

        if (self::has('request.format')) {
            $format = self::get('request.format', 'word');
        }

        return $format;
    }
public static function format()
    {
        $format = null;

        if (count(self::accept('format')) == 1) {
            $mime = explode('/', key(self::accept('format')));
            $format = $mime[1];

            if ($pos = strpos($format, '+')) {
                $format = substr($format, 0, $pos);
            }

            //Format cannot be *
            if ($format == '*') {
                $format = null;
            }
        }

        if (self::has('request.format')) {
            $format = self::get('request.format', 'word');
        }

        return $format;
    }
public static function format ( ) { $ format = null ; if ( count ( self :: accept ( 'format' ) ) == 1 ) { $ mime = explode ( '/' , key ( self :: accept ( 'format' ) ) ) ; $ format = $ mime [ 1 ] ; if ( $ pos = strpos ( $ format , '+' ) ) { $ format = substr ( $ format , 0 , $ pos ) ; } //Format cannot be * if ( $ format == '*' ) { $ format = null ; } } if ( self :: has ( 'request.format' ) ) { $ format = self :: get ( 'request.format' , 'word' ) ; } return $ format ; }
Return the request format

This function tries to find the format by inspecting the accept header,
only if one accept type is specified the format will be parsed from it,
otherwise the path extension or the 'format' request variable is used.

@return  string  The request format or NULL if no format could be found
Return the request format