On the TutsPlus.com site there's a new tutorial posted walking you through the [creation of a flat file CMS] in PHP. It's a simple Slim framework based application that allows the creation of basic pages with a header, footer and sidebar (as well as handling 404s and errors).
In the past tutorials, I have shown you how to create a flat file system content management system (CMS) using Go, Node.js, and Ruby.
In this tutorial, I am going to take the same design model and build a server using PHP. Since PHP isn’t a server by itself, but is usually paired with the Apache web server, I will show you how to set up the Apache web server inside a Vagrant virtual system.
He starts by helping you get the necessary libraries installed via Composer including the parsedown, lightcandy and Slim framework packages. From there it's into the code making:
- the front controller to define routes and set up an error handler
- defining the different templates (header, footer, etc)
- definition of "shortcodes"
- handling page processing (rendering the content into output)
The tutorial finishes off with the details on getting the server up and running: creating a Vagrant instance with Apache and PHP 5 installed and working together and serving code from a shared folder.