How it works
PHP describes the page. Latte renders the components.
The application has only a tiny renderer between your page definitions and the template engine.
A component definition
For example, this PHP definition:
['hero', [
'title' => 'Hello world',
'text' => 'Welcome to my site.',
'button' => [
'text' => 'Continue',
'url' => '/about',
],
]]
Maps to one file
The renderer looks for components/hero.latte and passes those parameters into Latte. You can add a new component by adding a new file.
That is almost the whole system.
You can add routing, forms, authentication, databases or APIs later without changing the basic component model.