antheia / framework
Frontend and interface framework for web-based applications.
Requires
- php: ^7.2 || ^8.0
- ext-gd: *
- ext-zip: *
README
A server-rendered PHP UI framework for building component-based web applications.
Antheia is a server-side UI framework for PHP that provides structured, reusable components while preserving full control over rendered HTML. It is built for applications that value predictability, testability, and long-term maintainability over client-side complexity.
⚠️ Antheia 3.x introduces namespace and package structure changes and is not backward compatible with 2.x.x releases. Please review the upgrade guide before upgrading.
Why Antheia?
Antheia is designed for applications that need structured, reusable user interfaces without adopting a full client-side framework.
It is a good fit when:
- You want server-rendered pages with a consistent, component-based layout
- You prefer server-side UI composition in PHP over full client-side SPA frameworks
- You need predictable HTML output that is easy to test end-to-end
- You want to avoid the complexity and build pipelines required by SPA frameworks
- You value long-term stability, explicit versioning, and controlled breaking changes
- Your application benefits from progressive enhancement rather than full client-side rendering
Antheia focuses on clarity, testability, and maintainability, while remaining flexible enough to integrate into existing PHP applications.
A live example of the interface (based on the current major version) is available at antheia.voipit.ro.
The demo uses the content from the examples folder.
Please check the project wiki for more details about the library.
Antheia is used in production by the Cloud PBX service Accolades, provided by VoIPIT Romania.
Who Antheia is NOT for
Antheia may not be a good fit if:
- You are building a fully client-side SPA where most logic and rendering live in the browser
- You expect real-time UI state management similar to React, Vue, or Angular
- You want a framework that hides or abstracts away HTML structure
- Your project relies heavily on frontend build pipelines and JavaScript-first tooling
- You are looking for a drop-in theme or CMS rather than a UI framework
Antheia is intentionally opinionated toward server-rendered applications with explicit structure and behavior.
Features
- Server-rendered component architecture
- Reusable PHP UI components
- Predictable HTML output
- End-to-end testing support
- Progressive enhancement friendly
- Minimal frontend build requirements
- Explicit versioning and migration policy
Installation
Use composer to install Antheia into your project:
composer require antheia/framework
After installation, you must configure a cache folder for Antheia before rendering any pages.
The cache folder:
- must be writable by the application
- must have a corresponding public URL
- should not be publicly writable beyond what Antheia requires
You can configure it at runtime using:
Globals::setCache(string $url, string $path);
The $url must point to the public URL of the cache directory,
while $path must be the absolute filesystem path.
Failing to configure the cache correctly will result in runtime errors. This requirement exists to allow Antheia to generate cached assets deterministically.
Quick Start
require __DIR__ . '/vendor/autoload.php'; use Antheia\Framework\Globals; use Antheia\Framework\Page\PageEmpty; // set up the cache folder Globals::setCache('/cache', __DIR__ . '/public/cache'); // create a new empty page $page = new PageEmpty(); // output the page content echo $page->getHtml();
PageEmpty represents the minimal Antheia page layout without predefined components.
This will render a minimal, empty Antheia page and output the generated HTML.
End-to-end testing
Most HTML items can have a test attribute (with the default name data-testid)
that will be output only when test mode is enabled. This is useful when the final
product needs e2e testing (for example, with
Playwright)
This allows stable selectors for automated end-to-end tests without affecting production HTML output.
require __DIR__ . '/vendor/autoload.php'; use Antheia\Framework\Globals; use Antheia\Framework\Page\PageEmpty; use Antheia\Framework\Header\TopRightMenu\TopRightMenuUser; // set up the cache folder Globals::setCache('/cache', __DIR__ . '/public/cache'); // create a new empty page $page = new PageEmpty(); // creates a menu on the top right side $option = new TopRightMenuUser(); // defines the testid value $option->setTestId('topMenuUser'); $option->setName('User name here'); $option->setHref('#'); $page->addTopRightMenu($option); // If Globals::setTestMode() is called then the HTML tag for // the menu will contain data-testid = "topMenuUser" // If the method is not called then the HTML tag will not // have the attribute Globals::setTestMode(); // output the page content echo $page->getHtml();
Supported Versions
- 3.x.x — actively maintained
- 2.x.x — security/legacy maintenance only
- 1.x.x — end of life, no longer supported
Please review the changelog for more details.
Documentation
All PHP code is documented using the PHPDoc standard. Most IDEs can provide code completion and inline documentation (the library is primarily developed using Eclipse PDT).
JavaScript files are documented using the JSDoc standard.
Examples located in the examples folder are explained in detail in the
project wiki.
For upgrade notes and breaking changes introduced in 3.0.0, refer to the upgrade guide and changelog.
Security
Please review our Security Policy for reporting vulnerabilities.
Credits
Icons used by the framework are provided by:
Color schemes for the predefined themes are provided freely by Scheme Color.
Images used by the framework are provided freely by Unsplash.
License
Antheia is licensed under Apache-2.0.
