yf PHP framework

yf is a batteries-included PHP 8.2+ framework for server-rendered sites: forms, tables, an admin panel, a database layer and 50 plugins come in the box. It runs more than 100 production sites, so backward compatibility is rule one.

Install Demos

What it can do

Modular by plugins

50 plugins (auth, users, content, shop, payments, cache, queue, i18n, API, admin). A project overrides one class or template at a time with the site__ / adm__ layers, no boilerplate.

Forms and tables in a few lines

form() and table() builders with validation, filters, sorting, paging and inline actions. See the form and table demos, or try validation and filter, sort and paging.

Database layer

MySQL / MariaDB and PostgreSQL drivers, a query builder, models, a migrator with tracking and an installer. See the SQL preview of the query builder.

Modern front end, opt-in

Bootstrap 5.3 and htmx 2 next to Bootstrap 3. A compat layer renders old Bootstrap 3 templates under Bootstrap 5, and the bundled themes are built and served by the framework (Bootstrap core loads from jsDelivr unless vendored with make assets-vendor). Try the Bootstrap 3 / 5 switch in the navbar, the htmx and theme demos.

Own template engine

Compiled .stpl templates with per-framework variants (main.bs5.stpl) and opt-in output auto-escaping; Twig 3 is available as a second driver.

Security switches per site

Admin CSRF guard, bcrypt / argon2id passwords with re-hash on login, a sodium encryption driver, session strict mode, trusted proxies and redirect allow-lists. Each is a flag: see Harden, the switches and the CSRF demo.

Caching and messaging

Files, Memcached, Redis, APCu and DB caches; Redis queues; Redis and RabbitMQ pub-sub.

Admin panel and multi-site

CRUD admin modules, a locale editor, dashboards, file manager and cron screens out of the box; several sites (per host) on one code base.

Integrations

8 mail drivers, 18 OAuth providers, 10 payment gateways (crypto, cards, Ukrainian banks), GeoIP, sitemaps and charts.

Tooling

A console with 24 commands (make module / model / plugin / admin, migrations, assets, cache) and PHPUnit suites in CI on PHP 8.4 / 8.5 with MySQL, MariaDB and PostgreSQL.

Upgrades without rewrites

A change of default behaviour ships behind a flag that keeps the old behaviour, so sites switch one at a time; the defaults flip only in a major release.

Open source

MIT licence.

Supported versions

AreaSupported
PHP8.2 or newer. CI tests 8.4 and 8.5, phpstan checks at 8.2, the dev Docker image uses 8.3
DatabasesMySQL 8.0, MariaDB 10.11 and PostgreSQL 16 (query builder, utils, migrator; the installer is MySQL / MariaDB only). Drivers mysqli, pdo_mysql, pgsql, pdo_pgsql. No SQLite
Cachefiles, memcache (ext/memcached, the default driver), redis (phpredis or predis), apc (APCu), db, tmp
CSSBootstrap 3.4.1 (default) and Bootstrap 5.3.8 (opt-in, css_framework = bs5). Themes bootstrap, slate and cyborg; own site themes under Bootstrap 5 (yf_bs_theme)
JavaScriptjQuery 1.11.3, jQuery UI 1.11.2, htmx 2.0.9
IconsFont Awesome 4.7.0 (Bootstrap 3); Font Awesome 6.7.2 with the v4 shims and Bootstrap Icons 1.13.1 (Bootstrap 5)
Templatesown .stpl engine (compiled); Twig 3 optional (twig/twig ^3.30)
Searchwrapper_search drivers: db_like (default; MySQL, MariaDB, PostgreSQL) and db_fulltext (MySQL / MariaDB FULLTEXT), Sphinx 3 and Manticore (SphinxQL over mysqli, port 9306), Elasticsearch 8 and OpenSearch 2 (REST over curl). Tested in CI against Manticore 29.9, Sphinx 3.9.1, Elasticsearch 8.19 and OpenSearch 2.19
Queue / pub-subqueue: Redis; pub-sub: Redis, RabbitMQ (AMQP)
Mailinternal, simple, PHPMailer, Mailgun, SendGrid, Brevo (Sendinblue), Amazon SES, Mandrill (abandoned)
LanguagesEnglish (the installer also seeds Ukrainian)

Documentation sections