lantern-lighthouse/responsivity
最新稳定版本:1.1.0
Composer 安装命令:
composer require lantern-lighthouse/responsivity
包简介
HTTP Response Utility Library
关键字:
README 文档
README
A lightweight PHP library for handling HTTP responses, rendering templates, and managing configuration in Fat-Free Framework applications.
Installation
composer require lantern-lighthouse/responsivity
Usage
JSON Responses
use Responsivity\Responsivity; // Simple success response Responsivity::respond(['success' => true, 'data' => $data]); // Error response Responsivity::respond( ['error' => 'Not found'], Responsivity::HTTP_Not_Found ); // Created response Responsivity::respond( ['id' => 123, 'message' => 'Resource created'], Responsivity::HTTP_Created );
Template Rendering
$f3 = \Base::instance(); Responsivity::render($f3, 'pages/home.html');
Configuration Management
$f3 = \Base::instance(); Responsivity::updateConfigValue($f3, 'database.host', 'localhost'); Responsivity::updateConfigValue($f3, 'app.debug', true);
Requirements
- PHP 8.1 or higher
- Fat-Free Framework 3.8 or higher
License
GPL-3.0 License
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2026-01-20