cakePHP
Moderator: General Moderators
cakePHP
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?
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?
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
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.
/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.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
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.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?
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
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??
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
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? 
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.
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
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.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?
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.
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
Thanks, that was actually I whole lot more helpful that wikipedia was on the subject.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.