PHPackages                             tokamak/tokamak - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tokamak/tokamak

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tokamak/tokamak
===============

A programmatic DOM rendering library with simple one-way data flow

04PHP

Since Apr 28Pushed 11y agoCompare

[ Source](https://github.com/bthecohen/tokamak)[ Packagist](https://packagist.org/packages/tokamak/tokamak)[ RSS](/packages/tokamak-tokamak/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Tokamak
=======

[](#tokamak)

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

[](#introduction)

Tokamak is a PHP library for programmatic DOM templating. It provides an abstraction over PHP's DOMDocument API, presenting a simple DSL for defining both templates and reusable components. This interface emphasizes unidirectional, top-down data flow and is (loosely) inspired by React.js. Unlike React, this library is used for stateless server-side rendering; therefore, elements in Tokamak are stateless, and are only rendered once.

Note: Tokamak is in the early stages of development and is not yet suitable for production usage. However, if its approach interests you, please do try it out and provide feedback.

Usage
-----

[](#usage)

### Documents

[](#documents)

You can create an HTML template by extending Tokamak's HTMLClass and providing an implementation of the render method:

```
