CakePHP as a Blog Platform

Building a blog using CakePHP is pretty easy. Heck, there's even a basic tutorial to do such on the CakePHP web site. This blog runs off CakePHP and was slammed together pretty quickly. My site over at Snook.ca will one day soon also get switched over to CakePHP. It's really quite flexible and handy for a developer like myself to get something up and running quickly.

But can an application be built to rival something like WordPress?

In building my site, I've been pondering just that. How would I set up plug-ins? How would I set up templates, themes and so on? And the one key thing that strikes me is that what a customer needs out of a blog tool is not the same as how a CakePHP application is normally designed.

For us developers, it's all about getting the data to the view. But for the end user, it's all about bringing the data into the view. That might seem the same thing but I'll explain the difference. In CakePHP-speak, the controller is the central player. It (duh) controls things. Whereas, in blogger-speak, the view is the central player.

You need a top 5 to go on your page? Query the model, and pass the variables on to your view, then loop through the set to get the output that you need. But blog tools are designed for the non-technical. They want to add a little "add code here" bit in the template to know what needs to be going on. But doing so means that the view becomes ultimately responsible for deciding what data needs to be pulled in.

Building an application with CakePHP in this way certainly isn't hard to do. A combination of helpers, elements and components could abstract away much of the stuff a user shouldn't really see, leaving them with a clean syntax for pulling data into the template but is this late-stage content pull mechanism practical with CakePHP?

Published August 27, 2006 · Updated August 27, 2006
Categorized as CakePHP
Short URL: https://snook.ca/s/698

Conversation

6 Comments · RSS feed
Chris Hoeppner said on November 26, 2006

Hi, Jon.

I'm actually building my blog with cake. The one online is using textpattern, until I get the other one fully working. It has been really a breeze to get things up and running, and after 3 hours or so, I found myself already working on the last details, which I'm still tweaking.

Yesterday a potential client contacted me, and after viewing his needs, the first thing I thought of was cake, of course. I have coded many sites from scratch, including a full blown cms for each site and it's needs. Cake takes care of much of the stuff I first had problems with, like handling stuff around safely with sessions, and taking care of my forms and my data abstraction layer (the models).

So far, I think of cake like I was taught to use my calculator back in school. I was only allowed to use it, if I was already able to do the job in my head. Cake can be thought of much the same. It really helps you if you already have the know-how to code it yourself, but you want to save yourself the hassle.

If this has any interest, I'd like to point out that it was you who pointed me to cake. Thank you so much. It has been a great step ahead.

Josko Gaberc said on February 02, 2009

I tried making a blog engine in CakePHP on my own also, using the tutorial on their website. I must say I was pleasantly surprised how simple that process was. CakePHP surely makes building a blog engine or cms really simple and straightforward. I plan on using CakePHP in the future also...

Vino said on February 19, 2009

I should fiind more information about this post

Mari said on February 19, 2009

We agree with all in this post! Thanxx

Laurka said on February 20, 2009

How may I start own journal?

Minecraft Guide said on March 15, 2011

It's interesting to see this point of view. I can't say fore sure if I agree or not, but it is something I will think about now.

Sorry, comments are closed for this post. If you have any further questions or comments, feel free to send them to me directly.

Want to learn about scaling CSS for large projects?

I'm available for full and half-day workshops on scalable CSS architecture. I can provide on-site training for your team. Interested?
Get in touch.