If you’re like me, you’ve been hearing “Ruby this” and “Rails that” everywhere you go. But I don’t have time right now to be playing with a new development framework, however nifty it may be. Busy, busy, busy, that’s me. I’ve got my perl programming to do at the day job, and in those tiny little niches of time that I can nab for other things, it’s generally PHP for me.
But maybe now we can have our Cake and eat it, too. Cake is a PHP framework based on Rails. Features:
- compatibile with PHP4 and PHP5
- supplies integrated CRUD for database and simplified querying so you shouldn’t need to write SQL for basic operations (although some familiarity with SQL is strongly recommended)
- request dispatcher with good looking, custom URLs
- fast, flexible templating (PHP syntax with helper methods)
- works from a website subdirectory, with very little Apache configuration involved (requires
mod_rewriteto work; these are available on most web servers)
So, if you’ve been wondering what the Ruby on Rails hoopla is about, maybe running through the Cake tutorial will give you a taste. One of the core ideas is to simplify the developer’s interaction with the database. Writing code to interact with the backend database is one of the most tedious things that a web developer has to deal with. It seems like every time we need to write even the simplest of applications, we end up re-writing the same functions over and over. Web application frameworks like RoR and Cake greatly simplify this process. You just set your tables up with a few standard fields, create a matching class which inherits from the framework’s database model, create a simple little view skeleton, and — BAM! — you’ve got your basic database interaction all wrapped up. The framework handles all the CRUD operations for you.