PHPackages                             piedweb/splates - 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. [Templating &amp; Views](/categories/templating)
4. /
5. piedweb/splates

ActiveLibrary[Templating &amp; Views](/categories/templating)

piedweb/splates
===============

Splates, a native PHP template inspired by twig system that's fast, easy to use and easy to extend.

0.0.1(3mo ago)226MITPHPPHP ^8.4CI passing

Since Dec 19Pushed 3w ago1 watchersCompare

[ Source](https://github.com/PiedWeb/Splates)[ Packagist](https://packagist.org/packages/piedweb/splates)[ Docs](https://dev.piedweb.com)[ RSS](/packages/piedweb-splates/feed)WikiDiscussions main Synced today

READMEChangelog (3)Dependencies (6)Versions (8)Used By (0)

Splates: Type-Safe PHP Template Engine
======================================

[](#splates-type-safe-php-template-engine)

A native PHP template engine with full IDE autocompletion and PHPStan support. Fork of [league/plates](https://github.com/thephpleague/plates), redesigned for modern PHP development.

[![Latest Version](https://camo.githubusercontent.com/21237252c8d659658ffc84b4985e1b23f4656c1fbd04b158f98ae0d07bbafd92/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f706965647765622f73706c617465732e7376673f7374796c653d666c61742d737175617265)](https://github.com/piedweb/splates/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Build Status](https://camo.githubusercontent.com/73d534d45d68dc279cdb9267e58ba6b8253564afbb3bda82dc90f89bcf3f0889/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f706965647765622f73706c617465732f7068702e796d6c3f7374796c653d666c61742d737175617265)](https://github.com/piedweb/splates/actions)

Why Splates?
------------

[](#why-splates)

- **Full IDE support** - Constructor parameters with `#[TemplateData]` provide autocomplete everywhere
- **PHPStan max level** - Every template is statically analyzable
- **No magic** - No string-based template names, no runtime errors from typos
- **Slots pattern** - Layouts are just components with `Closure` properties (no magic sections)
- **Value objects** - `Text`, `Html`, `Attr`, `Js` for context-aware escaping
- **Global services** - Inject dependencies via `Engine::addGlobal()` with `#[Inject]`

Installation
------------

[](#installation)

```
composer require piedweb/splates
```

Requires PHP 8.2+.

Quick Start
-----------

[](#quick-start)

### 1. Create a template

[](#1-create-a-template)

```

            Email:
