The CakePHP Framework: Your First Bite

You should update your links. Instead of http://manual.cakephp.org/pages/ch12, it’s now http://manual.cakephp.org/chapter/12.

In the rest, it’s a fine article, thanks for that.

What has annoyed me so far after getting stuck in today, is the case-sensitivity of application names. DVDs and Dvds are not the same.

File: /app/model/dvd.php


<?php

class Dvd extends AppModel
{
 var $name = 'Dvd';
} 

?>

File: /app/controller/dvds_controller.php


<?php

class DvdsController extends AppController
{
	var $name = 'Dvds';
	var $scaffold;
} 

?>

I have yet to get it working where it recognizes the applaction as a database of DVDs and not Dvds (and yes I have played around with the case in the class names.

Thanks for the tip, phpnut2. I hadn’t thought of using a PERL redirect. I’ll give it another go round.

Are you also phpnut from the cake screencasts? If so, thanks again!

I believe

var $uses = array(Note, AnotherModel, YetAnotherModel);

should be

var $uses = array(‘Note’, ‘AnotherModel’, ‘YetAnotherModel’);

Hmm?

(just a little picky thing, I’m reading the article right now and noticed it)

The above message fixed the problem I was having … I had to remove all the htaccess files also. Strange thing for me was that something view were working and others were not. I check my code over and over again and everything looked fine but I would get a 404 error when trying to access some pages. Once I turned on the BASE_URL then all pages would work without error. This tells me that something was wrong with server configuration and not a problem with my code.

Can you please update this article or at least say which version of CakePHP it will work in? I have wasted alot time with this article only to eventually find out that it does not work in more recent stable versions of CakePHP.

Thanks,

Mark

It’s a greate help for those who are new in MVC or such type of aechitecture.

The look and feel of CakePHP has changed since this article… Was kinda confusing at first to see the screenshots looking (quite!) different! Perhaps you could update the screenshots to match the new look and feel?

cake is one of the many cool php frameworks.
i would suggest checking out the QCodo framework.
And if you are a railsnut check out Akelos.

I just found out about Cake last week, and I have been combing through the CakePHP site and the web to learn more about it. Your article is by far the best I found to explain what it does and cleared up a few questions for me. Thank you!

check out http://codeigniter.com/ and http://www.symfony-project.com/ as well.

Thanks, that’s a great article. Very helpful. :slight_smile:

This article is not that much useful for beginners. In this article, author didn’t mention how to create the cakephp app.

If you go to the CakePHP website, there are plenty of examples of how to bake a cake :wink: .

I’ve personally enjoyed using CakePHP thus far. I am not saying it’s the best framework and with any framework, you will have people for or against it. I think the biggest thing when evaluating a framework is how it suits the needs of yourself and your application. I think too often many of us get lost in what others say is better and not figuring that out for yourself.

Nice article, thank you!

It doesn’t work after page 1. I created the 2 files mentioned, where they are supposed to be created, and if I navigate to my installation (localhost/cake1/notes/) I get a 404…

John, if you are using apache web server, you must enable the mod_rewrite module (in the httpd.conf file) in order to get these urls to work. Good luck :wink:

I appreciate the article, after fighting with mod_rewrite which I googled and found an IBM article which showed the difference between a working and non-working mod rewrite. Everything fell into place.

hi, pls delete this comment…
just to notify that the following line’s (.net)'s explanation is irrelevant.

>>Official CakePHP IRC channel: #cakephp on irc.freenode.net

amazing article :slight_smile:

i think you should update this tutorial. the current tutorial is not working with latest version of cakePHP.

example :

$html->input is depreceated, it will confuse the reader (since I assume 80% of the reader is beginner)

$form->input

thanks & goodluck