CakePHP

CakePHP Bake – Baking Models, Controllers and Views the CakePHP 1.2 Way

Patty Cake, Patty Cake, Baker’s Man One of the things that sold me on CakePHP is the bake routine. This is basically code generation for the lazy types like myself. It was good in CakePHP version 1.1, now it’s just awesome. The only way they can make it better is to implement a web version, but that’s another story. What Baking Does In CakePHP we refer to the automatic code generation as baking (get it now?

The CakePHP Bakery Is Out Of Yeast

Today I popped onto the CakePHP Bakery looking for the obAuth Component. To my surprise, I got a blank page. Seems like there’s a database issue. Here’s hoping that it’s not down for too long. Update (11/20/07): Most of the stuff is back up on the bakery. The rating is still a small issue, but all the code and tutorials are up and running. Bake On!

CakePHP vs. Ruby On Rails – A Very Bias Look at Why I Choose CakePHP

First of let me state that this post is very bias towards CakePHP. Truth be told, I haven’t even installed or used Ruby on Rails. The closest I’ve come is looking at various code snippets I’ve found around. With that said, you may want to stop reading now.

These arguments are not based on hard facts, since I haven’t done much research on the matter. A lot of them come from a post at Clickable Bliss discussing the PHP vs. Ruby On Rails Issue.

  1. Steep Learning Curve - Laziness

One thing I really hate is learning stuff. It is especially bothersome when you're trying to crank out a project or web application in a limited amount of time.

With CakePHP I'm required to learn about the **MVC style of development** as well as CakePHP **conventions**.

With Ruby on Rails, I would have to learn MVC, Ruby on Rails conventions and I would have to s**tart from scratch with the Ruby programming language** as well.

Cute CakePHP Trick of the Day – GenerateList Empty Slot In List

With this post I’m introducing a new segment to this blog: Cute CakePHP Trick of the Day. This is basically going to be a learn as I learn sort of thing. There are always a bunch of little things that I want to do in CakePHP, but just haven’t figured out. So every time I stumble onto something, I’ll let you guys in on it. I love the GenerateList() function. This is generally used when you have models with associations with other models.

Give Me 15 Minutes and I’ll Make You A jQuery Expert

Introduction In the spirit of rapid web development, I’ve stumbled upon jQuery. Here’s a testimonial from a jQuery user: You start with 10 lines of jQuery that would have been 20 lines of tedious DOM JavaScript. By the time you are done it’s down to two or three lines and it couldn’t get any shorter unless it read your mind." In my experience it’s been more like five (5) lines of jQuery.

The Secret of CakePHP Advanced Routing – Even Better URLs

The power of CakePHP has a lot to do with conventions. The framework (like many others) harnesses its power by enforcing certain conventions and standards that users must follow. You name your database tables, file names, etc; a particular way and boom, models, views and controllers are automatically created and ready for use. This is the beauty of the MVC structure. Your URLs also follow thing structure: www.site.com/controller/action/params.

Straying From Convention

But sometimes, conventions suck. Sometimes you want greater control over things, but still don’t wanna do them from scratch. The strictness of the MVC structure dictates how your URLs will look. Consider this: CakePHP has a basic pages controller, which you can use when you don’t need a model or controller. You just enter the view and voila , a page. But your pages have a URL of:

www.site.com/pages/page

Wouldn’t you rather:

www.site.com/page.htm

The Routes Configuration examples in the CakePHP manual are a bit simple. Here’s how to use a bit more advanced routing:

Router::connect('/(.*).htm', array('controller' => 'pages', 'action' => 'display'));

This says, consider everything that comes in with an HTM extension and send the URL as a parameter to the display action on the pages controller.

The idea was stolen from Lumad CMS. They use the following in Rewrite in .htaccess for their pages:

RewriteRule ^~(.*) content_pages/displayurl/$1 [L]

They use a prefix of ‘~’ instead of a suffix of ‘.htm’, but you get the picture. I’m sorry to disappoint you, I’m not as creative as you thought.

XAMPP Lite on USB Disk – Benchmark PHP and MySQL by Slowing Down Your Server

To develop PHP and MySQL on a Windows machine, I usually use WAMP. I had tried XAMPP before, but I found that it was a bit bloated, with the OpenSSL and FTP Server, etc. So WAMP it was. But lately, I decided to give XAMPP another try and I like what I’ve got so far. For the past three weekends, I’ve been away from my personal computer. The only life line I’ve had is my stock of Portable Apps on my 512MB USB disk.

CakePHP Installation Guide: Just Add Water and 2 Medium Eggs

Introduction As you guys know, I’ve recently discovered the marvels of rapid web development with CakePHP. This shall be the first in a long serious of CakePHP related material coming from me since I’ve now veered off on a slightly different focus. After a short analysis, I’ve picked CakePHP as my framework of choice. I’ve been struggling through it for a few months now, but it’s by far better than the alternative of coding by hand (Yeah, I know I’m lazy).

New Domain: WebDevelopment2.com, New Focus: Frameworks, CakePHP, Javascript, Web 2.0

New Domain I has finally occurred to me that I should have gotten my own domain name a long time ago. Really, I don’t know what I was waiting for, but it was about time. Since my focus is Web 2.0, WebDevelopment2.com was an obvious choice. I’ve already written about moving wordpress to a different domain, so moving to this domain was walk in the park. I loaded up PhpMyAdmin and exported my database.

Enter CakePHP – Rapid Development Framework – No Really!

Almost two months ago I mentioned that I was looking into some PHP Frameworks I must say, that I’ve procrastinated with the whole thing. Since then I’ve caught up on a few. A friend of mine tried introducing me to Code Igniter framework. I didn’t really get a good feel for it. He mentioned that it was more powerful and flexible, but I’m lazy, so I was looking for a lazy man PHP Framework.