Official documentation

Understand PHPAML.
Build without guessing.

Practical guides and reference for the autonomous AML 1.2.x environment.

Quick start

Create an application

AML downloads the official template, verifies its checksum, and installs the engine in an isolated environment.

aml create my-project
cd my-project
aml install
aml doctor
aml serve

The site is available at http://localhost:8000. Changes trigger an automatic browser refresh.

Concepts

Project architecture

my-project/
├── app/
│   ├── Controllers/
│   ├── Models/
│   ├── public/{css,js,img}/
│   └── views/partials/
├── configs/app.php
├── database/migrations/
├── tests/
├── aml_env/
└── index.php

Work in app, configs, database, and tests. The aml_env contains the engine and its dependencies.

CLI

Essential commands

aml create .Create in the current folder
aml installInstall engine and dependencies
aml doctorDiagnose the environment and project
aml routesList routes
aml testRun tests
aml updateInstall the latest version
HTTP

Routes and controllers

'GET /users/{id}' => [
  'handler' => [UserController::class, 'show'],
  'middleware' => [AuthMiddleware::class],
  'name' => 'users.show',
],
Interface

Views and public files

The template provides header.php, footer.php, css/index.css, js/main.js, and img/favicon.svg.

Livraison

Before production

aml install --production
aml doctor --json
aml routes
aml test
Note

aml serve is for development only. In production, use HTTPS and APP_DEBUG=false.