cakePHP

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

cakePHP

Post 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?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post 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.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post 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?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post 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.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post 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??
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post 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.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post 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??
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post 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:
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post 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.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post 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.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post 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?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post 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.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post 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.
Gambler
Forum Contributor
Posts: 246
Joined: Thu Dec 08, 2005 7:10 pm

Post 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.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post 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.
Post Reply