← Alle berichten

From modules to resources, and why the word changes

The engine directory is classes/, functions.php and resources/. Two of those three names are inherited; the third is chosen.

The pre-Phlo generation has classes/, functions.php, modules/, views/ and templates/. Anyone who has written PHP for long enough recognises that layout. The generation after it splits the middle into libs/ and functions/, and those two now merge into one tree. What changes across all three is not the shape but what that directory promises.

A module is something the application includes and then works with. It is present, and the rest of the code is written knowing it is present. A resource is declared instead: an app lists what it wants in data/app.json, and only those are loaded, transpiled and shipped. An app that never sends mail carries no mail code, and its release build contains none.

That difference is what the rest of the design leans on. Because resources are a declared list rather than an ambient library, @ requires: can pull dependencies in by itself, the installer can show a catalog and let you pick, the release build can exclude what a customer server should not carry, and a generated manual can describe exactly the app in front of you rather than the framework in general.

views/ and templates/ are gone, since a view is a node inside the class that owns it. classes/ and functions.php keep their names because they keep their meaning.

See the Configuration chapter.

We gebruiken essentiële cookies om deze site te laten werken. Met uw toestemming gebruiken we ook analytics om de site te verbeteren.