6: The example app
The phlo-demo-cms repository is a blog/magazine on SQLite, built to be copied.
6.1: What is in it
- Five models:
article,author,category,topic,comment. - Every relation type: parent (author, category), many (topics), child (comments).
- Image uploads on covers and avatars, and a
wysiwygbody. - One portable database: every model stores in
data/cms.db.
6.2: One-command setup
composer install -d data/ # Faker, used only by the seeder
php www/app.php seed::run # create tables + ~30 articles with comments
seed::run drops and recreates every table, so it is always safe to start over. The first HTTP request compiles the sources automatically.
6.3: Make it yours
Copy the repository, replace the models in modules/, update %app->models and %app->menu, and adjust the CREATE TABLE statements in seed.phlo to match. Remember the relation-column convention from the Relations chapter: the foreign key is the related model's short name.