Blog tutorial for CakePHP 1.2

Published on and tagged with cakephp  documentation  tutorial

The blog tutorial from the manual is probably the tutorial most use resp. used to make their first steps with CakePHP. Unfortunately, it doesn’t work with CakePHP 1.2, if you follow the tutorial you will get notices and warnings. Not really a nice welcome :|

Ahsan wrote some time ago an article in which he explains how you can make the blog tutorial work with Cake 1.2. It is not a tutorial on its own, it is more a complement to the tutorial in the manual.

Yesterday, Thomas Diehl has published in his blog a “Blog tutorial for CakePHP 1.2” trilogy (in german). In the first part he introduces some CakePHP basics. Part two is very similar to the blog tutorial from the manual. And in the third part he extends the rudimentary blog by adding comments and writing a helper. It is a good start for german-speaking newbies who want to begin directly with CakePHP 1.2.

21 comments baked

  • Chris Meller

    Speaking as someone who took a look at Cake and decided to go with another framework (Code Igniter, but that’s hardly the point), the blog tutorial was one of the key reasons for my decision.

    When the “here’s an easy guide to follow along step-by-step” guide breaks at the 3rd step, it’s more useless than if there were no guide at all. Now I’m left wondering if it was something I did that screwed me up as I tried to follow along with the tutorial.

    Unfortunately, the lack of documentation (and the accuracy thereof) is a major failing for Cake. People looking to use a framework are looking to do so because they don’t have (or wish to spend) the time reinventing the wheel over and over. On the same token, they don’t have time to totally dissect an existing implementation of the wheel to figure out how to attach it to their wagon.

    As a great man once said: if it isn’t documented, it doesn’t exist. It doesn’t matter how great Cake is – it’s still a mass of tangles until someone takes the time to document and explain how to use it.

  • agreeed

    cakePhp is massive, but if you are a noob with frameworks, DO NOT try cakePhp. the documentation is so fucking poor its crazy! When you know another framework, you MIGHT get the handle of cakePhp.

  • Tim Daldini

    Chris, it seems that you had expectations towards the framework, and things didnt really work out as you planned. Let me tell you, I’ve been there!

    I used it for a “real” project, knowing very little about PHP and absolutely nothing about CakePHP. I just chose the framework because some of its main features really made sense to me, and there I went. Soon it became clear that some parts of the framework we’re simply…buggy (at the time! It has improved a lot since then.)…and on top of that, there -really-is not that much official documentation.

    My conclusion is, if you have no experience with the framework, and you NEED to get this project done in the near future…well…at least think it over, because despite the fact CakePHP is very extensible, and has some really cool features I personally think that it has a slow learning curve for several reasons.

    So I understand what you mean, but unfortunately, there is no one to blame ;) What framework you will use is completely up to you.

    But yeah, I got frustrated many times, espcially as I was reading “Who needs documentation when it tells me how to do everything?” every time I got to the site asking for help in the chatroom, reading the API, the tickets…

  • cakebaker

    @all: Thanks for your comments!

    @Chris: I agree with you that the documentation is a big weakness of CakePHP. I think the problem is that there are two different teams (dev team and doc team) which are not really coordinated, and so stuff doesn’t get documented.

    @agreeed: Yes, if you want to get the handle of CakePHP you have quite often to dive into the source code to understand what’s going on. And that’s something not everyone likes to do…

    @Tim: “Who needs documentation when it tells me how to do everything?” -> this person probably lives in a different world ;-)

  • Tim Daldini

    @Cakebaker: Actually that is a Jonathan Snook quote. ;)

  • Brandon Parise

    It’s quite obvious to anyone that documentation is not a high priority to the devs. Check out the source code, it’s riddled with ambiguous commenting and semantically confusing naming.

    A short example on what I base my frustrations on:


    – The docs makes no mention that $name can EITHER be a string or an array of strings. The doc says ‘string’ as type when it’s obviously ‘mixed’.

    – Also, if $name is an array, will it return true if ALL columns in the array exist or just one? (The answer is: just one)

    – Semantically speaking, why is it named hasFIELD when it’s checking the existence of a COLUMN? You can argue that field and column are synonymous but for me it’ a matter of congruity.

    In closing… to all those who think that once 1.2 becomes stable that these “issues” will resolve themselves… think again. The cake devs are smart cookies but it seems they are too impulsive or lazy to really manage the project effectively. Maybe they need to hire the two Bob’s (office space joke, sorry ;)).

    Also, I am not trying to sit here and point out all of cake’s faults. I am too vested professionally in this framework to bash it outright. But, I do feel that my choice to go with cake has been a tough one to uphold.

  • cakebaker

    @Tim: *g*

    @Brandon: Thanks for your comment.

    Yes, there is quite some semantically incorrect stuff in cake like the example you have shown.

    If I see this method, I wouldn’t expect I could pass an array of names (and I am not able to predict the result in this case without looking at the source).

    Whether the function is called hasField or hasColumn is for me not that important (I often use the term “Field” myself), more important for me is that whatever term is used is used consistently. But that’s not the case in the model, both terms are used.

    Unfortunately, the devs are rather ignorant if you point them to such issues…

  • Mitchell Schoenbrun

    Speaking of newbies and documentation, just try to figure out what “bake” does. Apparently it’s an important cool feature, but I’m a month into cakephp and still can’t find where it is explained.

  • cakebaker

    @Mitchell: If you use CakePHP 1.2 these articles may help: . And if you use 1.1, simply go to the scripts folder and call php bake.php.


  • Rafeek


    can i have the 21 things must know on CakePHP.

    Thank you


  • cakebaker

    @Rafeek: You are looking for this article:

  • hcker2000

    I to have tried using cakephp with xampp and have read the blog tutorial in the manual and watched the screen cast. I have never been able to get it working so I switched from looking at using cakephp to framework and have had no issues fallowing there tutorials. Every thing works as it should.

  • cakebaker

    @hcker2000: Sad to hear that. Anyway, good luck with Code Igniter, and maybe you will give Cake a second chance in the future ;-)

  • robert

    I noticed another problem is the instability of it, I need a framework that need i18n, so I chose cakephp, sad to say the cakephp 1.2 beta is too unstable, I used cakephp 1.1 stable before, after switching to cakephp 1.2, there are alot more random errors like, database will not update, some of the self referencing database relationship will not fetched, etc

  • cakebaker

    @robert: If you can reproduce some of the issues, please report them so that they can get fixed.

  • Baz L

    Funny thing is that I have the opposite problem. I tried CI (recommended by a friend) and couldn’t get it to work right.

    Documentation was a big problem before. But they released the book: and things are going a bit smoother now.

    Also, BAKE rocks. It was by far, the quickest way to learn the framework.

  • cakebaker

    @Baz: I never used CI, so I can’t say anything about it.

    And yes, with the book application the documentation situation has become better.

  • rishi

    can I know step by step process to develop a Ecommerce website.

  • cakebaker

    @rishi: I’m sorry, but I’m not aware of any such tutorial. Maybe the coming version of phpShop ( is something for you?

  • Al

    To be honest I dont think Cake is the best tool for blogs, I better like wordpress, but a blog on this site would be great but lets see if it comes, also a cake creation :)

  • cakebaker

    @Al: Well, as always, it depends. A framework like Cake is useful if you want to write your own blog engine because you have special requirements (or whatever). On the other hand, WordPress is useful if you want to use a proven product and you don’t need the flexibility of a custom solution.

© daniel hofstetter. Licensed under a Creative Commons License