- Config file (recommended)
- Fluent API
Create lex.config.json
Place this file at your project root. Lex walks up from the current working directory to find it automatically.
lex.config.json
Template name resolution
Template names use dot notation — dots are converted to directory separators:| Template name | Resolved 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
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