Fabulous PHP frameworks: CakePHP

CakePHP combines easy installation with command-line tools that jump-start development, striking a good balance between small and large

1 2 Page 2
Page 2 of 2

One of CakePHP's more important view helpers is the AjaxHelper, which employs the Prototype and script.aculo.us JavaScript libraries to simplify the use of AJAX in an application's view system. You pass into the AjaxHelper an associative array that specifies behavior such as whether AJAX calls are synchronous or asynchronous, which elements are passed to the server, which DOM elements are updated by the returned information, and so on. The helper reads this array and manages all the behind-the-scenes drudge work for you. It also supports callbacks that allow you to hook into the AJAX process before, during, or after the actual AJAX call is made.

Both models and controllers support callbacks as well, allowing your application to hook into CakePHP's processing at specific points. Thus, attaching a callback to a model using CakePHP's beforeSave() call allows your application to intercept processing just before data is saved to the database (which you might employ to encrypt the data before it's stored).

Up from the database
As suggested by CakePHP's motto, application development typically begins with the database. Create a database and tables, establish a connection to the database in your CakePHP application (one of the rare times that you actually configure something in CakePHP), run the Cake script to build your model access files, and when you open your application's home page, CakePHP displays a welcome page that not only verifies that you've set the system up properly, but also provides recommendations for securing the website. For example, it will recommend that you change the security salt string -- used for generating cipher hashes -- to something other than the default value. From this starting point, you build your application outward, adding controllers and views.

CakePHP's documentation consists of an online CookBook, which is a combination reference guide and tutorial. Actually, the CookBook provides two tutorials; one leads you through creating a simple CakePHP application, the other concentrates on authentication and security features. An API reference is also online and lets you browse the framework by class, file, or package. The CakePHP site maintains documentation for the three most recent releases, which is a nice feature if your application was written in one of the framework's earlier versions. If you're a visual learner, the website's community section hosts CakePHP TV, a small collection of videos covering various CakePHP development topics.

CakePHP's no-configuration-necessary organization is a welcome respite from frameworks that require crawling around configuration files before your development work can begin. Its documentation is well organized, too, and its enforced conventions encourage good development habits. CakePHP strikes an excellent balance between quantity of features and ease-of-use.

Read the reviews of other PHP frameworks:

Also on InfoWorld:

This article, "Fabulous PHP frameworks: CakePHP," was originally published at InfoWorld.com. Follow the latest news in software development and PHP at InfoWorld.com. For the latest business technology news, follow InfoWorld.com on Twitter.

Copyright © 2011 IDG Communications, Inc.

1 2 Page 2
Page 2 of 2
How to choose a low-code development platform