tempest/responsive-image
Composer 安装命令:
composer require tempest/responsive-image
包简介
Server-side responsive images with PHP
README 文档
README
Generate responsive images with PHP and render the correct HTML.
Important
This package is still a work in progress! Feel free to open issues.
Quickstart
composer require tempest/responsive-image
use Tempest\ResponsiveImage\ResponsiveImageFactory; use Tempest\ResponsiveImage\ResponsiveImageConfig; $config = new ResponsiveImageConfig( srcPath: __DIR__ . '/path/to/image/sources', publicPath: __DIR__ . '/../public', ); $imageFactory = new ResponsiveImageFactory($config); $image = $imageFactory->create('/parrot.jpg'); echo $image->html; // <img src="/parrot.jpg" srcset="/parrot-1920-1280.jpg 1920w, /parrot-1606-1070.jpg 1606w, /parrot-1214-809.jpg 1214w, /parrot-607-404.jpg 607w">
In depth
Read the full docs here: https://tempestphp.com/docs/packages/responsive-image
统计信息
- 总下载量: 272
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-29