My Blog

CodeIgniter

Building this site with CodeIgniter 4

This site is a small CodeIgniter 4 application on top of a ready-made HTML theme. Most pages are static, and the only part that talks to a database is the contact form.

For a personal site I wanted something I can change in a few minutes, without a build step or an admin panel to keep secure.

One layout, many pages

Every page extends the same layout view, which holds the sidebar, the footer and all the theme's CSS and JavaScript. A page only fills its content section, so adding a new one means a route, a small controller and a view.

Content without a database

Projects and blog posts live in plain PHP data files. They are versioned in Git together with the code, and publishing a post is just another deploy.

The contact form

  • Every message is validated and saved to the database first.
  • Only then is it emailed to me, so a mail server problem never loses a message.
  • A hidden honeypot field and CSRF protection keep most spam away.

Closing thoughts

Not every website needs a big framework or a CMS. For a site like this one, a light framework and a few well-organised views are easier to maintain and fast to load.

All posts