Page 1 of 1

cakePHP

Posted: Tue Jun 20, 2006 10:50 pm
by Luke
OK, so I have decided to use cakePHP as my framework for building my client control panel and all applications available to my clients. I am reading the manual and have gotten as far as Views.

I really like the way cake works, and I like the ease of use, but I don't understand one thing... where do you put files? It doesn't really explain this... Jcart?

Posted: Tue Jun 20, 2006 10:58 pm
by John Cartwright
firstly each page requires a controller, a view, and a model.. so each page that you make requires 3 seperate files in 3 seperate locations. I'm not on my devbox right now but I believe its simply found at

/app/controllers/
/app/models/
/app/views/

Make sure you pay close attention to their naming conventions aswell.. and if you do what I do and like to copy and paste files instead of creating new files you want to be careful you don't accidently put one of those files in the wrong folder. I ran into a bug which took me a couple hours to figure out because I had done that, because their autoloader isn't clever enough to avoid grabbing the correct file from the correct folder. Once it runs into a file with the correct naming convention anything it looks it will stop at that.

Posted: Tue Jun 20, 2006 11:02 pm
by Luke
Will I need to upload this whole cakephp directory with all these directories for every project, or can I run multiple applications from one set of core cakePHP files?

Posted: Tue Jun 20, 2006 11:05 pm
by John Cartwright
The Ninja Space Goat wrote:Will I need to upload this whole cakephp directory with all these directories for every project, or can I run multiple applications from one set of core cakePHP files?
I just ran multiple instances of cakephp core, things like configuration become a problem if you are running multiple files through a single core. To tell you the truth I never really looked into it carefully, but from what I could tell you likely wouldn't be able to.

Posted: Tue Jun 20, 2006 11:07 pm
by Luke
OK... so if I have 3 applications on one server, all using the cakePHP framework, they all need their own directories with seperate core cakephp structures??

Posted: Tue Jun 20, 2006 11:09 pm
by John Cartwright
The Ninja Space Goat wrote:OK... so if I have 3 applications on one server, all using the cakePHP framework, they all need their own directories with seperate core cakephp structures??
My answer is not concrete, but yes.

Posted: Tue Jun 20, 2006 11:17 pm
by Luke
that seems odd... but I can see how it would cause problems if you had 3 apps using one core... but let's say cakephp comes out with a new version and I am interested in upgrading a couple months down the road... how will I do this if I have 10 clients each with 4 or 5 apps using their own cake php core??

Posted: Tue Jun 20, 2006 11:19 pm
by John Cartwright
I lied.. check out http://groups.google.com/group/cake-php ... 9a275fc4cb (I havn't actually gone into it yet though).. and let me know will ya? :wink:

Posted: Wed Jun 21, 2006 5:07 pm
by Luke
Has anybody used the Access Control Lists? I am trying to set one up, but when I try to go to the file they suggest, mod_rewrite messes things all up. I can't go to it because the famework thinks I'm trying to access a view.

Posted: Thu Jun 29, 2006 2:43 pm
by Luke
CakePHP has to have the WORST documentation of anything I've ever used. The manual is TERRIBLE. It just leaves out like huge chunks of critical information. I am so frustrated by their horrible manual. As soon as I get good with cakePHP, I'm starting a support site for it so poor people like me can come and not be confused an irritated.

Posted: Fri Jun 30, 2006 9:26 am
by Ollie Saunders
I can sympathize Space Goat.
I'm trying out the Zend Framework at the moment and the documentation for it is very minimalistic.

Could someone tell me what exactly a model is supposed to be?

Posted: Fri Jun 30, 2006 9:40 am
by John Cartwright
ole wrote:I can sympathize Space Goat.
I'm trying out the Zend Framework at the moment and the documentation for it is very minimalistic.

Could someone tell me what exactly a model is supposed to be?
Documentation has to assume you are at a certain knowledge level. Key in MVC into google for a better understing of the seperation of Models, Views and Controllers and their responsibilities.

Posted: Fri Jun 30, 2006 10:04 am
by Luke
yes, explaining models would probably be beyond the scope of their documentation. There are a grippe of good articles about the model view controller concept, but my best explanation of a model class is a way of describing a data source such as a database table so that a controller (or logical code) knows what to expect from it and how to deal with it.

Posted: Fri Jun 30, 2006 10:21 am
by Gambler
The problem with things like Cake, IMO, is not documentation, but the complexity and amount of conventions. You can always try to read the code. That's how I studied Rails, anyways. And I'm not even that good with Ruby.

Posted: Fri Jun 30, 2006 8:57 pm
by Ollie Saunders
The Ninja Space Goat wrote:yes, explaining models would probably be beyond the scope of their documentation. There are a grippe of good articles about the model view controller concept, but my best explanation of a model class is a way of describing a data source such as a database table so that a controller (or logical code) knows what to expect from it and how to deal with it.
Thanks, that was actually I whole lot more helpful that wikipedia was on the subject.