..check it out the Foldi blog for updates on work, clients, etc...

Archive for June, 2009


Basic search with CakePHP Part 2 – search criteria

Sunday, June 28th, 2009

This is part 2 of the Basic search with CakePHP where we’ll present the search criteria in a more user-friendly way. The files here build on part 1.

Here’s the working example.

(more…)

How to not lose URL params on form validation errors with CakePHP

Friday, June 26th, 2009

This problem makes me crazy every time I run into it. And the thing is, I know I’ve fixed it before and can never remember how. So I’m making this post as much for me as anyone else who may be stuck with losing URL parameters when a validation error occurs on a form.

Here’s a working demo.

(more…)

Basic search with CakePHP Part 1 – HABTM, joins and pagination

Wednesday, June 17th, 2009

This will be a multi-part demonstration for building basic search functionality using CakePHP. Part 1 focuses on searching across models that have HasAndBelongsToMany relationships. Here’s a working demo of Part 1.

You see this type of search when looking for items that share similar properties. In the demo, it’s Bars that have Features (WiFi, TV, etc), Scenes (Lounge, Afterhours, etc) and Neighborhoods (Chelsea, Soho, etc). HABTM search is also useful for searching items that share Tags, Colors, Size, Flavor and on and on.

(more…)

UPDATE – An easy and intelligent pagination menu for CakePHP

Monday, June 15th, 2009

I’ve been meaning to write an update to this post and supply a working demo….so here you go. Check out the demo. Please notice the letters “H”, “I”, “J” and “R” are ghosted because there are no user records beginning with that letter in the database.

In the last post I showed you how to create a directory menu that only provided links that would return results. I’ve since cleaned up the presentation by adding styles and Cake-ifying the important query that gets all the active links in the menu. I’ve also added a little jQuery to help zebra-stripe the results.

(more…)