Multiple Validation as Behavior in CakePHP 1.2

After some inspiration from a recently published Bakery article, I decided to convert my multiple validation function into a Behavior. Even better, I've thrown it into my plugin collection to make it super easy to drop into any project.

Using the new behavior is much like using the script as it was before. You can name the validation properties to include the action name and it'll automatically set that validation set as the default.

Multiple Validation Sets in CakePHP 1.2

In CakePHP, you define how your data should be validated by setting parameters on the validate property of your model. In version 1.2, there is an on option that can be set on a specific rule that, when set, is either create or update. This allows you to define different rules depending on the type of action being performed. That, in combination with the required and allowEmpty properties, give you a fair amount of control over different validation rules [...]

CakePHP Debug Styles

I just wanted to document this somewhere but whenever I work on a CakePHP project, there's always the debug info that sits at the bottom of the page. It's big and bulky and once I'm off the default CakePHP styles, it's usually pretty ugly.

I've done various stylings but I finally took a moment to implement a really simple idea: Fixed position the table and then use hover styles to toggle the visibility. It's still not a perfect solution but darn close and certainly good enough for my needs right now [...]

Easier Static Pages for CakePHP 1.2 Update

So it seems that the old code I had didn't work in debug mode, although on the current CakePHP 1.2 RC2, I'm not even sure it works at all. However, I decided to take some time to revisit the code. Last time, I simply hacked up the missingAction and missingController calls and it felt kludgy. It looked kludgy.

This time I took a closer look at how the dispatch was being handled. Daniel Hofstetter made mentioned how using the error handler seemed inappropriate since it's for handling errors. Unfortunately, the Dispatcher looks for a missing action or controller and if it can't find them, it sends it off to the AppError class well before anything else [...]

Why Twitter Survives

...or why I think Mashable is wrong.

Mashable has an interesting article that places Twitter's popularity purely on its simplicity. Even more bold, it believes that people haven't left Twitter because of its simplicity. Its competitors are simply too complex [...]

Don’t Listen to the Hecklers

This is my response to James Bennett's post on the Designer vs Developer debate but I thought it worth sharing my view point here.

So it’s high time we all got over our little internecine feuds and started acting like the professionals we claim to be. That means learning to work with with our colleagues, no matter where they fall on the spectrum of specialized industry knowledge.

Honestly, it's much ado about nothing. You've managed to find some quotes from people who may or may not have any relation to the web design industry and certainly have no impact on what you do and how you do it and who you do it with.

I've spent 10 years in the web design industry with teems of teams of designers and developers working together on projects and rarely have I heard this kind of harassment [...]

@media 2008 Wrapup

I know it's been a couple weeks since @media but I did want to document my thoughts and, of course, point people to some resources.

First of all, I thoroughly enjoyed the conference. It's certainly on a much smaller scale, probably closer to something like Web Directions North. What I'm finding is that the two track smaller conference seems to be a great size. It gives you plenty of content to absorb while still offering up plenty of opportunities to have meaningful conversations with people [...]

Snogs

If there's ever a quintessential application to build when you first dive into a framework, it's the blog. That's what I did with Snook.ca when I first got into CakePHP.

Then for a recent client project, also built using CakePHP, I was asked to integrate a blog. I took this opportunity to take a chunk of the code I used to build my own site and break it out into its own blog plugin: Snogs. [...]