Write templates in PHP,
not in a custom language.

Nate is a Twig-inspired template engine that leverages native PHP features. No parsers, no custom syntax, no compilation step — just PHP with template inheritance and auto-escaping.

page.tpl.php
<?php $this->extends('base.tpl.php') ?>

<?php $this->block('content') ?>
    <h1><?= $this->title ?></h1>
    <ul>
        <?php foreach ($this->items as $item) : ?>
            <li><?= $item ?></li>
        <?php endforeach ?>
    </ul>
<?php $this->endblock() ?>

Why Nate?

Native PHP Syntax

No custom template language to learn. If you know PHP, you already know Nate. Use loops, conditions, and functions directly.

Template Inheritance

Full support for extends, block/endblock, and parent(). Build multi-level layouts just like Twig.

Auto-Escaping

All output is automatically HTML-escaped by default. Use ->raw() when you need unescaped output. XSS protection built in.

No Compilation Step

Templates are plain PHP files executed directly. No CLI commands, no cache warming — just include and render.

Partial Includes

Include reusable template partials with includeTemplate(), passing data just like you would with any PHP function.

Lightweight

Just 5 core classes, zero external runtime dependencies. Install with Composer and start templating immediately.

Nate vs. Twig

Same power, different philosophy — you choose the syntax.

Nate (Native PHP)

<?php $this->extends('layout.tpl.php') ?>

<?php $this->block('content') ?>
    <h1><?= $this->title ?></h1>
    <p><?= $this->body ?></p>
<?php $this->endblock() ?>

Twig (Custom Language)

{% extends 'layout.html.twig' %}

{% block content %}
    <h1>{{ title }}</h1>
    <p>{{ body }}</p>
{% endblock %}

Ready to try Nate?

Install it with Composer and start building in minutes.

Get Started →