Documentation · Chapter 02

Understand a PHPAML
project architecture.

Before adding pages, learn how a request travels through the project and why every folder has one precise responsibility.

≈ 35 min

Architecture is a map, not a constraint.

As a project grows, the challenge is not only writing code: you must know where it belongs and who should call it. PHPAML organizes that conversation so routes, controllers, models, and views do not perform the same job.

The journey in one mental picture.

1RequestGET /products
→
2Routeselects the action
→
3Controllercoordinates
→
4ResponseHTML / JSON

The model participates when the controller needs data. The view participates when the result must become an HTML interface. An API can return JSON without a view.

Chapter objectives

  • Follow a request from browser to response.
  • Identify public, application, and rebuildable folders.
  • Separate responsibilities with MVC.
  • Recognize the structure for each project type.

SUMMARY

What to remember

  • Architecture shows where each responsibility lives.
  • The route selects; the controller coordinates.
  • The model represents data; the view presents the result.
  • All PHPAML variants share the same principles.