cakephp......anyone else use it?

Status
Not open for further replies.


Yup, been using it ever since 0.0x. Coded my Affiliate/Arbitrage/Nichesite Management tool in it.
 
Yup, been using it ever since 0.0x. Coded my Affiliate/Arbitrage/Nichesite Management tool in it.

I got into it after doing a project in Rails. I enjoyed working with Rails greatly, but finding a good, cheap Rails shared host is a pain in the ass (downtime and performance can be pathetic). So, i searched around and found Cake. I've done 3 public webapps in it, and haven't been disappointed. It 'forces' you to use a MVC architecture, and that's a GREAT thing.
 
Yeah, I love Cake. I'm building a pretty "big" web app right now in Cake, and it's great. I never got into Ruby because I couldn't stand the syntax, seemed unnatural to me. I do love the MVC framework though and all of the cool associations.
 
Yeah, I love Cake. I'm building a pretty "big" web app right now in Cake, and it's great. I never got into Ruby because I couldn't stand the syntax, seemed unnatural to me. I do love the MVC framework though and all of the cool associations.

Yeah.....the ruby syntax is awkward. The language has the ability to do complex iterations and loops in just a few lines of code. I finally got used to it, and then PHP felt awkward while transitioning back. :error: The same app in rails looks a lot 'cleaner' than in cake, but you gotta battle with the hosting issues. Both frameworks are very capable, however.
 
I've looked at Cake, and was looking at it while I was deciding whether or not to hop on the RoR/Django bandwagon. I ended up going with RoR, just for something new, and hey, never hurts to learn another language right?

That said, I much prefer the ruby syntax for things, as coming from a Java/C background, PHP has always felt dirty. One thing I noticed about CakePHP is that they try to emulate a lot of the thing in RoR, which is ok, but some of the things in RoR are there because they take advantage of the Ruby structure and language, and is more ackward when done in PHP. They should really be focusing on integrating the strengths of PHP rather than just trying to emulate RoR for PHP.

I'm sort of off my ruby kick right now, haven't programmed in a while. Have a site I was planning on making, and I might give CakePHP a shot. I hear symphony is good too.
 
I did a big app in Rails and then turned right around and learned cake. The BIG drawback of cake versus rails (for me) is in the way object properties are accessed. For example, say you have a DB table, 'Person', and a 'lastName' column and a 'firstName' column. In rails, you access the properties (column data) as so:

Code:
myperson.firstName 
myperson.lastName

In cake, you have to do this associative array mess that still feels awkward to me:

Code:
$myperson['Person']['firstName'];
$myperson['Person']['lastName'];

When you start having your relationships defined, the associative arrays get really confusing (to me at least). I find myself doing a bunch of var_dumps on these arrays just to keep myself in line.
 
Thats exactly the type of thing I'm taking about shaggz. Some things just feel ackward.. It should be more OOP style:

Code:
$myperson->firstName;
$myperson->lastName;
Then again, I don't particularly care for the way PHP does a lot of OOP things either.
 
I'd consider myself a fairly advanced php developer. I've looked at a few different php frameworks, and I did like Cake the best.

Symfony - seemed cumbersome and messy to me. I dunno, I know it has a huge following, not for me though.

Prado - If you really like the Component -> Event driven model of programming (such as ASP.NET) this might be for you. The Prado framework kind of mimics the way Asp.NET gives you access to html elements as objects, etc. Seems pretty neat.

PHP on Trax - Might be one to watch. Not much documentation or support yet. Syntax looks very much like RoR, I think. Check this out.
 
CodeIgniter blows cake out of the water.

It's more flexible, has a deeper set of classes and the URL's are more flexible. I can create a site with CodeIgniter that has none of the duplicate url issues that CakePHP causes.
 
CodeIgniter blows cake out of the water.

It's more flexible, has a deeper set of classes and the URL's are more flexible. I can create a site with CodeIgniter that has none of the duplicate url issues that CakePHP causes.

I wouldn't say it blows cake out of the water. I'm sure they're both equally powerful frameworks. I actually looked at code igniter before choosing cake. The only reason i picked cake was that I was familiar with its general framework due to my Rails experience. I'm d'loading a demo vid on code igniter right now (one of the 'blog in 20 minutes with ajax' things). I'm curious to see how it stacks up now that i have more cake experience.
 
Hey Shaggz, if you wouldn't mind posting a super quick review of code igniter I would really appreciate it.

Alright. Quick blurb on Cake vs Code Igniter.

Based on what I saw on the 3 video demos (and a 6 page "cake vs CI" thread on the code igniter forum), 80% of the same MVC functionality is in both frameworks. Both have the model, view, and controller folders. Both have the same methodology of mapping a URI segment to a function in a controller (say, w w w.sample.com/blog/output -> MAPS TO -> function output() in "/Controllers/blog.php" ). Both have nice helpers to use while building your view pages (from what i saw, CI may have a small advantage here).

Differences......

It looked like the code igniter scaffolding allows you to work with your models (insert test data), but they don't output any scaffold php files for you to begin working off of (like cake's 'bake' does). I may be wrong on this, but from what i saw on the vid demos, no code was autogenned.

Active Record (database interaction). Code Igniter uses some great syntax, and addresses one of the issues i mentioned above. Specifically, they allow a database query and data access like:

Code:
// find person with last name of 'Thomas'
$this->db->where("lastName = 'Thomas'");
$person = $this->db->get("person");

echo $person->lastName;
echo $person->firstName;


The approach above is much more intuitive to working with data objects than cake's associative array approach.

What CI didn't have was any data relational capabilities. In cake i could define that a "person 'has and belongs to many' usergroups" in cake, and cake would automatically execute the multiple queries to populate my person's usergroups. However, in CI, you have to manage writing these sql queries yourself. If one is working with a complex database structure, cake may be the viable answer.

One weakness to the above fact is that cake's ORM support in active record does contribute to making it much slower than CI. CI is a lighter weight solution and that should be taken into account.

CI looks to be a bit easier to learn than cake. The syntax is more easily read. Plus, the documentation appears to be a bit more robust from a beginners standpoint.

In the end, i feel i could have built any of my 3 cake sites in CI. I would say one of them (simple DB model) would have been faster to build in CI. I know one (complex DB relationships) would have faster in Cake. It all comes down to what your requirements are and which framework you can pick up faster (or already know).
 
  • Like
Reactions: aim
Status
Not open for further replies.