PHPackages                             concept-labs/simple-http - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. concept-labs/simple-http

ActiveLibrary[HTTP &amp; Networking](/categories/http)

concept-labs/simple-http
========================

(C)oncept-Labs Simple HTTP Application

1.3.1(6mo ago)010[1 PRs](https://github.com/Concept-Labs/simple-http/pulls)1Apache-2.0PHPPHP &gt;=8.2

Since Jul 15Pushed 2mo agoCompare

[ Source](https://github.com/Concept-Labs/simple-http)[ Packagist](https://packagist.org/packages/concept-labs/simple-http)[ RSS](/packages/concept-labs-simple-http/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (14)Used By (1)

Simple HTTP
===========

[](#simple-http)

A lightweight, modern PHP HTTP application framework built on PSR standards, designed to simplify web application development while maintaining flexibility and power.

🚀 Why Simple HTTP?
------------------

[](#-why-simple-http)

Simple HTTP provides a streamlined approach to building PHP web applications with:

- **PSR-Compliant**: Built on PSR-7 (HTTP Messages) and PSR-15 (HTTP Handlers) standards
- **Easy Request Handling**: Intuitive request/response abstractions with powerful handler system
- **Flexible Layouts**: Component-based layout system with template support
- **Minimal Configuration**: Get started quickly with sensible defaults
- **Modern PHP**: Requires PHP 8.2+ with full type safety and modern features
- **Extensible**: Plugin system and middleware support for customization

✨ Key Features
--------------

[](#-key-features)

### Powerful Request Handlers

[](#powerful-request-handlers)

- **SimpleHandler**: Abstract base for creating custom request handlers
- **PageHandler**: Specialized handler for page-based applications with layout support
- **LayoutableHandler**: Handler with integrated layout rendering capabilities

### Flexible Response Building

[](#flexible-response-building)

Build responses with an elegant fluent API:

```
$handler->status(200)
    ->header('Content-Type', 'application/json')
    ->json(['message' => 'Success']);
```

### Layout System

[](#layout-system)

Component-based layout system with:

- Template rendering with PHTML templates
- Nested components and layouts
- Context management for template variables
- Plugin support for template transformations

### Built-in Utilities

[](#built-in-utilities)

- JSON response helpers
- File download support
- Redirect helpers (including referer redirects)
- Header management utilities

📦 Installation
--------------

[](#-installation)

Install via Composer:

```
composer require concept-labs/simple-http
```

### Requirements

[](#requirements)

- PHP 8.2 or higher
- Composer

🎯 Quick Start
-------------

[](#-quick-start)

### Basic Handler Example

[](#basic-handler-example)

```
