v2

You're ready to build.

Documentation

Guides, API references, and tutorials to get started.

Template Engine

Layouts, components, slots, and directives.

Routing

Attribute routes, middleware, and RESTful resources.

Configuration

MLC config files, env variables, and typed access.

PHP 8.4 MonkeysLegion v2.0 Production
Template Engine

This page is the template

Every feature you see is powered by the ML Template Engine. Edit resources/views/home.ml.php to start building.

@extends('layout')
Layout inheritance
@section / @yield
Content sections
{{ $var }}
Escaped output
{!! $html !!}
Raw HTML output
@if / @foreach
Control directives
<x-component>
Components & slots
@push / @stack
Asset stacking
@env('dev')
Environment checks
app/Controller/HomeController.php
use MonkeysLegion\Router\Attributes\Route;
use MonkeysLegion\Http\Message\Response;

final class HomeController
{
    #[Route(methods: 'GET', path: '/')]
    public function index(): Response
    {
        return Response::html(
            $this->renderer->render('home', [
                'title' => 'Welcome',
            ])
        );
    }
}