This page is rendered directly from a .djot file using DjotView.
Instead of writing PHP templates, you write content in Djot markup. The view class automatically converts it to HTML.
View variables can be inserted using {{varName}} syntax. For example, the title above uses Djot View Demo.
Djot-PHP provides:
public function documentation(): void
{
$this->viewBuilder()->setClassName('Markup.Djot');
$this->set('title', 'My Documentation');
}
This approach works well for:
DjotView is ideal for content-heavy pages where the markup is the primary content, not dynamic data rendering.
Back to Djot Helper examples | Back to Markup overview
</div>