php8.5
Home/ Manual/ reference / yaf/ Yet Another Framework

Yet Another Framework

The Yet Another Framework (Yaf) extension is a PHP framework that is used to develop web applications.

Intro

The Yet Another Framework (Yaf) extension is a PHP framework that is used to develop web applications.

Unlike typical PHP frameworks, Yaf is written in C and compiled as an extension: the framework classes, the autoloader, the router and the dispatch loop all run in compiled code, so the per-request framework overhead is measured in microseconds rather than milliseconds, and there are no framework PHP files to load. It is designed for high-traffic applications where bootstrap cost matters, and for long-lived service runtimes (such as Swoole) where each request needs a clean dispatch cycle.

Yaf implements the classical MVC architecture with a single entry script, a configuration file with environment sections, bootstrap hooks, a plugin system with seven dispatch hooks, six built-in route types, a PSR-0 style autoloader (Yaf_Loader) and a lightweight PHP template view (Yaf_View_Simple).

A simple Yaf benchmark can be found at Yaf Performance. For a quick start guide, please refer to the Tutorials section.

Note

Yaf requires PHP 7.0 or newer (the master branch of its source repository); a php5 branch supports PHP 5.2 and newer.

Setup Constants Tutorials Appconfig Yaf-application Yaf-bootstrap-abstract Yaf-dispatcher Yaf-config-abstract Yaf-config-ini Yaf-config-simple Yaf-controller-abstract Yaf-action-abstract Yaf-view-interface Yaf-view-simple Yaf-loader Yaf-plugin-abstract Yaf-registry Yaf-request-abstract Yaf-request-http Yaf-request-simple Yaf-response-abstract Yaf-response-cli Yaf-response-http Yaf-route-interface Yaf-route-map Yaf-route-regex Yaf-route-rewrite Yaf-router Yaf-route-simple Yaf-route-static Yaf-route-supervar Yaf-session Yaf-exception Yaf-exception-typeerror Yaf-exception-startuperror Yaf-exception-dispatchfailed Yaf-exception-routerfailed Yaf-exception-loadfailed Yaf-exception-loadfailed-module Yaf-exception-loadfailed-controller Yaf-exception-loadfailed-action Yaf-exception-loadfailed-view

Source: reference/yaf/book.xml · from the official PHP manual (php/doc-en)