PHPackages                             f4php/framework - 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. [Framework](/categories/framework)
4. /
5. f4php/framework

ActiveLibrary[Framework](/categories/framework)

f4php/framework
===============

F4 is a lightweight web development framework

v0.2.5(2mo ago)0151↓50%2MITPHPPHP ^8.4.1

Since May 17Pushed 1mo ago1 watchersCompare

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

READMEChangelogDependencies (33)Versions (63)Used By (2)

About
=====

[](#about)

This is F4, a lightweight PHP/PostgreSQL-based web application development framework.

Quick start
===========

[](#quick-start)

To quickly start a new application, you should refer to [f4php/f4](https://github.com/f4php/f4) package, which works as a self-documented skeletal application.

In order to create your own project using [composer](https://getcomposer.org/), use the following command:

```
composer create-project f4php/f4

```

and then follow [official documentation](https://github.com/f4php/f4).

Developer's guide
=================

[](#developers-guide)

Introduction
------------

[](#introduction)

F4 is a very lightweight framework, it provides a developer with minimal web app infrastructure and tries its best to let you focus on application-specific logic.

Architecture
------------

[](#architecture)

F4 framework architecture includes several key elements, but most of the developer-facing features are documented in [f4php/f4](https://github.com/f4php/f4). If you just want to try coding with F4, definitely start there.

The main feature that is not documented elsewhere is the bootstrap process, which is described below.

### F4\\Loader and F4\\Core

[](#f4loader-and-f4core)

F4's core philosophy, similar to other PHP framworks, is based on the idea that it controls (or takes over) the processing of any incoming HTTP request, and allows app developer to focus on a (mostly) declarative description of how the to handle the request.

F4 uses its own bootstrap process to initialize itself and collect any app-specific information (coming in the form of `Module`'s') before passing instances of `Request` and `Response` to app-specific `Route`'s. It also provides a flexible PostgreSQL-compatible database query builder as a `DB` class.

Code below is the only part that is placed in a web server root folder (`public/index.php` by default).

Each bootstrap phase supports custom handlers that allow low-level intervention. It is highly unlikely that your project would ever require this feature, but it's there if you need it.

```
