Blog  
 
  Lextech Blog  

Recent Articles

Making Money
With Technology
Systems
Engineering

Lextech

Tech News

Posts Tagged ‘CakePHP’

Debug CakePHP in Eclipse - Bake Cakes Not Brownies

by: Jeff

Thursday, June 5th, 2008

Having developed several CakePHP projects in Eclipse, I’ve always been on the lookout for things to make my life easier. Not too long ago I stumbled across an addition to Eclipse’s PHP Development Tools (PDT), which integrates the Zend/Xdebug debuggers into the Eclipse environment. The ZendDebugger binaries are available for OS X, Linux and Windows platforms at Zend’s website http://www.zend.com/en/community/pdt.

Also on this page, you may also find an all-in-one bundle for Eclipse that has everything you need to get started. Once the debugger is loaded in PHP and your web server has been restarted, you can open Eclipses debug dialog and create a new PHP Web Page profile.

First configure the “PHP Server” section to point to the development server your project exists on. Then set /<project name>/app/webroot/index.php for the “File” section of the PHP server debug dialog as well as http://<host name>/ , index.php respectively for the two entry boxes of the “URL” section. On the advanced tab select “Debug All Pages” and the debugger will now recognize any breakpoints in all .php files in your project!

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • Digg
  • Facebook
  • Slashdot
  • Technorati

CakePHP… Brain Dessert for PHP Developers

by: Jeff

Tuesday, May 13th, 2008

The guys over at CakePHP have whipped up something full of awesomeness for the PHP community. They have provided a tool to make our lives easier and more productive by removing the hassles of creating redundant boilerplate code using a framework to cleanly build web applications. I’ll briefly delve into what Cake is and why I think it is so awesome.

The main concept to learn behind cake is the Model-View-Controller (MVC) architecture. This basically means that the code to handle data (model), the code to handle html (view), and the code to handle logic (controller) is neatly broken up into three separate files. In essence, the controller gets data from the model (usually synonymous with a database table) and figures out what it wants to do with the data, then supplies the view with the processed data. Additionally, if you want to get started quickly, you can declare a variable called scaffold in your controller and CRUD pages will be auto-magically created for that table in your database!

To take things a step further, you can run a command line utility that can create permanent copies of these CRUD pages and help you define relationships between your models. The CakePHP project is very active and I’ve only glanced on a couple of the cool features.

Once you get in the mindset of using it, which includes familiarizing yourself with some naming conventions and taking full advantages of models instead of making raw queries, you’ll be creating PHP sites in a fraction of the time. (For further information about getting started, please look at The CakePHP Manual.)

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • Digg
  • Facebook
  • Slashdot
  • Technorati