Skip to main content
Configuration comes from three places, with different lifetimes and audiences.

Environment variables

.env is loaded at bootstrap, falling back to .env.example for keys it doesn’t define. These settings belong to the installation, not the business.

Application

Database

Frontend and assets

Sessions, logs and tooling

Read them with the global helper, which takes a default:
Environment variables are exposed to Twig as the env global. Read a specific key when a template genuinely needs one, and never dump or serialize the object.

Config values

Computed at bootstrap and injected by ID:
Two more IDs are set alongside them: version, read from the VERSION file, and license.

Options

Options are rows of JSON, edited by administrators. They’re loaded once per request and exposed as dot paths:
In Twig they’re all under option:

Common option groups

Writing options

Writes merge into the existing JSON: nested objects are merged recursively, and lists are replaced. DeleteOptionCommand removes a key, including a nested one. Administrator-facing forms post to the options API rather than calling this directly. See Admin settings pages.

Which layer to use

Options require a database, so anything needed before the database exists, such as the debug flag, has to be an environment variable.