2020-12-28 1321次浏览

Version 1.1.0 of yiisoft/http package was released.

ContentDispositionHeader was introduced. It helps building Content-Disposition header that complies to RFC-6266 and works in majority of modern browsers:

$name = \Yiisoft\Http\ContentDispositionHeader::name();

$value = \Yiisoft\Http\ContentDispositionHeader::value(
    \Yiisoft\Http\ContentDispositionHeader::INLINE,
     'avatar.png'
);

$value = \Yiisoft\Http\ContentDispositionHeader::inline('document.pdf');

$value = \Yiisoft\Http\ContentDispositionHeader::attachment('document.pdf');

Also, Method::ANY is now deprecated in favor of Method::ALL.

More details could be found in the package README.