Choose based on the expected output.
Do not choose a variant because it sounds more modern. First ask: who will use the program, and what response should they receive? An HTML page, reactive interface, JSON data, or terminal text naturally lead to four different structures.
They are not four different languages.
In all four cases, you write PHP. What changes is how the program is used. A visitor may receive a complete page, interact with a reactive interface, another application may request data, or a person may run a terminal command.
Classic application
It receives an HTTP request, uses routes and controllers, then generally renders a PHP view on the server.
src/controllers/
src/models/
src/middleware/
src/routes/WebApp.php
src/views/
public/index.phpAML View
It keeps the PHPAML server, while declarative pages and components live under src/views. Engine then handles compiled frontend interactions.
src/views/pages/
src/views/components/
src/views/layouts/
src/views/stylesheets/
src/routes/WebApp.phpAPI
It uses HTTP, routes, controllers, and data, but has no view layer. Its final representation is generally JSON.
src/controllers/
src/requests/
src/resources/
src/repositories/
src/routes/
public/index.phpConsole
It has no browser, HTTP request, or route. Program::main() receives terminal arguments and returns an exit code.
src/Program.php
src/
tests/
phpaml.jsonThe same catalog, four uses.
aml createaml create-viewaml create-apiaml create-consoleQuick comparison.
HTMLServer-rendered websites and formsReactive interfaceDashboards and interactive applicationsJSONSharing data between applicationsText and exit codeAutomation, learning, and scheduled tasksCHECK YOUR UNDERSTANDING
Must an API have a view?
Show the answer
No. Its final representation is generally JSON. It keeps routes, controllers, and data, but does not need an HTML layer.
YOUR TURN
Choose a variant for: an interactive dashboard, a nightly backup command, a mobile service, and a small institutional website.
Show a hint
View, Console, API, then Classic.
BEGINNER QUESTIONS
You may be wondering…
Can I add Data to these projects?
Yes. The Data module can be added when a project must store and retrieve information.
Does a View application still have a server?
Yes. PHPAML and Engine work together to produce the interface and its interactions.
Can I start simple and add modules later?
Yes. The initial type provides a suitable structure; required modules can then be installed.
SUMMARY
What to remember
- Classic renders pages on the server.
- View adds a declarative reactive interface.
- API responds without views, generally as JSON.
- Console runs PHP without an HTTP server.