Quantcast
Channel: The Weber Report » Web Development
Viewing all articles
Browse latest Browse all 15

CakePHP – The Best PHP Framework

$
0
0

CakePHP RC2It has been a while since I’ve written much about CakePHP (let alone anything on my blog), but I thought I’d update the world with my latest thoughts in case anyone was interested.

I’ve come a long way since I first started using CakePHP.  In fact, I’ve now used the product on some fairly high end sites and had really good luck with it.  There have been minor quibbles here and there (still revolving around documentation mostly), but I’m now a solidified “Baker” through and through.

I will save you some time looking elsewhere and reading the reviews about all the different PHP frameworks; use CakePHP, it’s the best.  In my humble opinion, the only better framework available is Ruby on Rails (which I’d also highly recommend); but if you are stuck using PHP – CakePHP is your best bet.

This framework will encourage (and teach) you to follow through with good web development habits.  These skills are both in programming style (using standardized naming conventions, proper variable scope, documentation, et cetera), but also in technical areas as well (proper database modeling, mvc  code separation, secure user input validation and cleaning, and efficient function development).

Now that I understand the majority of the tenants of Cake, I can say with confidence that it’s a quality product.  1.2 RC2 solved almost all of the minor/major problem I had with the framework and it seems stable as all get out.  Cake will help you use fast, efficient, and complex SQL queries without a sweat.  It will allow you to create fancy “web 2.0′ esque” sites using AJAX and fancy doo-dads with ease.  It will easily validate your input data without the need for you to much of anything.  It provides easy ways to offer web services, shell scripts, and test your code quickly and easily using SimpleTest.  …And that’s just scratching the surface.  The other advantage is it’s super easy to pull in outside code into your projects using components and helpers.  The framework is rigid where it needs to be and flexible in the areas that are key.

In simple terms – “Cake Saved My Life“.

So How Do I Learn It?

You need to learn the basics of PHP first; I think this writeup is an excellent starting point (though I wouldn’t recommend wasting any time with the Zend framework).  I’ve seen a few people on the web talking smack about CakePHP, when the problem was that they really didn’t understand PHP.

Once you have mastered the basics of PHP, go to book.cakephp.org and read the whole thing on version 1.2 of Cake (currently RC2); don’t waste your time learning 1.1.  You can read it in just a few hours and you don’t have to understand it all at that point.. just try to grasp the basics.  If you’ve never worked with the MVC design pattern, then read those sections over a few times until you get it.  Then, install it using the specific directions in the book (read it carefully).  Now is the time to start using Apache2, MySQL, and PHP 5 if you aren’t yet.  I don’t care if you are Windows, UNIX, or Mac… use the products that are the most popular and you’ll make your life easier.

After you get it installed, make up a wild test application in your head and sit down and code it.  Don’t worry about making it pretty; just learn how to code it right.  Learn how HABTM’s work, learn how automagic form validation works, learn the ajax helper details — learn it all!

So to review:

Dustin’s tips to mastering CakePHP:

  1. Learn PHP (Don’t waste your time messing with Zend though)
  2. Read The Book (learn version 1.2)
  3. Install It (Use Apache2, a recent release of MySQL, and PHP 5… no matter what OS you are on; break your IIS addiction or PHP 4 addiction NOW)
  4. Create a test site in your head and finish it within a reasonable time frame.  Force yourself to finish it.
  5. Love it

Almost every problem you’ll come across should be answered in the CakePHP book now; so no excuses for not being able to get it going.  If you have configuration problems, make sure you search through the Google Group; it’s a vastly helpful resource.

Also, don’t forget to look through the Bakery, you can find a ton of code in there to help you solve common problems.


Viewing all articles
Browse latest Browse all 15

Latest Images

Trending Articles





Latest Images