PHPackages                             fignon/fignon - 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. fignon/fignon

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

fignon/fignon
=============

Fignon is a middleware chain runner which starts with an http request and end with an http response. Fignon ease how to create php website and rest api.

0.0.1(2y ago)12MITPHPPHP &gt;=8.0.0

Since Feb 16Pushed 2y agoCompare

[ Source](https://github.com/FignonPhp/fignon)[ Packagist](https://packagist.org/packages/fignon/fignon)[ Docs](https://github.com/FignonPhp)[ RSS](/packages/fignon-fignon/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (2)Used By (0)

Fignon Framework
================

[](#fignon-framework)

Fignon is an ExpressJs like framework for PHP. It is designed to be simple and easy to use.

[![The Fignon Framework Architecture](./docs/fignon.png)](./docs/fignon.png)

Fignon Framework is designed around a notion of `Tunnel`, `Tunnel Station`, `Middleware`, `Middleware Runner`. It also has the strongest support for any view engine, database, orm, etc.

App
---

[](#app)

[![Tunnel and Tunnel Station](./docs/tunnel.jpg)](./docs/tunnel.jpg)

The application itself is called a `Tunnel`. like real tunnel (👆). A `Tunnel` is a stack of `Tunnel Station`. A `Tunnel Station` is a middleware group which can be mounted in a common base path. Yes, you got it, both `Router` and `App` are both instance of `TunnelStation`. `TunnelStation` which expose apis to register middlewares like to register routes with specific http method and path like `$app->get('/', function (Request $req, Response $res) { /* ... */ })`.

The Tunnel is the `middleware runner`;

Middlewares can be easily grouped and mounted in a common base path. This is useful to create modular and reusable middlewares.

Installation
------------

[](#installation)

You can install Fignon Framework with composer:

```
composer require fignon/fignon
```

For more, [see the project readme](https://github.com/FignonPhp)

If you need to start quickly a RESTful API or a Web app based on Fignon, consider using our skeleton:

```
composer create-project fignonphp/skeleton my-fignon-app
```

Usage
-----

[](#usage)

Here is a simple example of a Fignon app that responds with "Hello World" when you visit the root URL:

Just copy and paste it after you have installed the framework with composer and run it with `php -S localhost:8000 -t public` and visit `http://localhost:8000` in your browser.

```
