Skip to main content
This guide gets you from installation to a working rendered page in under five minutes.

Template name resolution

Template names use dot notation — dots are converted to directory separators:
Template nameResolved file
'home'views/home.lex
'layouts.app'views/layouts/app.lex
'partials.header'views/partials/header.lex
'admin.users.index'views/admin/users/index.lex

Rendering methods

// Render a named template (dot notation)
// In dev mode, this also injects the debug payload for DevTools
$html = $lexer->render('home', ['title' => 'Hello']);
In development mode, render() automatically injects a __lex_debug__ JSON payload into the HTML response for the Chrome DevTools extension. In production mode (setProduction()), no payload is injected — zero overhead.

Next steps

Template syntax

Learn echo, directives, loops, and includes

Layouts & components

Build pages with layout inheritance and reusable components

Configuration

Explore all configuration options and the fluent API

Production mode

Optimize for production with precompiled templates

Build docs developers (and LLMs) love