BoltCM

Sophisticated, Lightweight and Simple

Jump to docs navigation
Edit on GitHub

Internals ยป The 'Model'

The way Bolt handles its ContentTypes is defined in the contenttypes.yml file, which in turn determines the data-structure of the website.

Basically, whatever is defined in the ContentType gets added as columns to the database that's configured in config.yml.

Whenever the 'dashboard' is displayed, Bolt checks if the definitions in contenttypes.yml matches the database columns, and if it doesn't it urges the user to go to the 'repair database' screen.

Even though Bolt strives to be as simple as possible, it makes sense to think of Bolt as an MVC application. Silex provides the Controller part, the Twig templates are the View and the ContentTypes define the Model part.

All access to the content and the ContentTypes is done through the Storage class. Records of content have a Content class. Browse the files src/Storage.php and src/Content.php for details.


Couldn't find what you were looking for? We are happy to help you in the forum, on Slack or on IRC.
Spotted a typo, or have something to add? Edit this page on GitHub.