Directory structure
The skeleton installs the four framework packages, and the admin panel or the API when you choose them. See framework and packages for their responsibilities and versions. Applications that enable modules also add the module layout described in modules.
A new FloCMS project is small. Here is what each folder is for. To see how these pieces work together on a request, read the request lifecycle.
The project root
my-site/
├── admin/ Admin panel resources and pages, when you added the panel
├── api/ JSON API: routes.php, Controllers/, Resources/ (php flo api:install)
├── commands/ Your own php flo commands (App\Commands), including SetupCommand
├── config/ config.php, schedule.php and bootstrap.php
├── controllers/ Page controllers (FloCMS\Controllers)
├── database/ migrations/ and seeders/
├── includes/ Startup helpers: maintenance mode, class aliases (compat.php)
├── lang/ Translations: en.php, ar.php, ku.php
├── models/ Models (FloCMS\Models)
├── public/ The web root: index.php, themes/, uploads/ (and api.php with the API)
├── storage/ Logs, cache and framework state (not in Git)
├── support/ Application classes such as LoginThrottle (FloCMS\Support)
├── templates/ Layouts, partials and error pages per template
├── tests/ PHPUnit tests
├── vendor/ Composer packages (not in Git)
├── views/ One folder of views per controller
├── .env Your environment settings (not in Git)
├── composer.json Packages, with version ranges (composer.lock has the exact ones)
└── flo The command-line launcher: php flo
public/
public/ is the only folder the web server should serve. Point your domain's document root at it.
index.phphandles every page request.api.phphandles/api/v1/...requests, oncephp flo api:installhas written it. See building an API.conf_global.phpdefines constants every request uses, such asACTIVE_LANGandVIEWS_PATH.themes/<template>/holds CSS, JavaScript, images and fonts. In templates, link to them withtemplate_asset('css/style.css').uploads/receives uploaded files.
controllers/, models/ and views/
A page is a controller action plus a view:
controllers/BlogController.phphandles/blog.views/blog/index.htmlis the view for itsindex()action.models/BlogModel.phptalks to the database.
php flo make:route Blog creates all three. See controllers and views.
templates/
Each template is a folder, and APP_TEMPLATE in .env picks the active one. A template can override any file of the default template; files it doesn't have come from default.
templates/default/
├── layouts/ default.html (site) and admin.html (admin panel)
├── partials/ Pieces you include in layouts
├── errors/ 403, 404, 500, 503 and database error pages
└── offline.html
storage/
storage/ holds files the application writes: logs/, cache/ and framework/ (maintenance mode and scheduler state). The web server must be able to write to it, and to views/cache/, where compiled templates go. php flo storage:check --fix checks and creates these folders.