Posted on 31 January 2009, 9:28 am, by klenwell, under
Code Case.
Problem In CakePhp, I want to invalidate a field submitted in a form and set the error message dynamically. If the error message is set by a validation parameter within the model, the new message should override that error message and be displayed by the form in the view. Overview Consider the following three cases [...]
Posted on 25 January 2009, 7:16 pm, by klenwell, under
Code Case.
Problem I need to validate input from a textarea field. I want to allow a few tags, like a, i, b, etc. But everything else needs to be filtered out. And the input should be checked to see that its is nested properly. Overview User input sanitization and validation is one of those things that [...]
Posted on 20 January 2009, 9:26 pm, by klenwell, under
Design.
I confess I skipped most of the inauguration. I’m not one for pomp nor circumstance (skipped my college graduation — both times.) But just saw the new White House home page and I’m impressed. Here’s a comparison side-by-side (new Obama page to the left, of course): To be fair, that’s an older version of the [...]
Posted on 17 January 2009, 11:05 am, by klenwell, under
Code Case.
I wanted to use the CakePhp pagination helper to paginate some complex records. The model that the paginator was referencing had both belongsTo and hasMany associations. belongsTo associations are not a problem. hasMany, I discovered, are — which makes sense when I think about. As the ticket notes: You can only paginate LEFT JOIN tables [...]
Posted on 10 January 2009, 10:46 am, by klenwell, under
Code Case.
In HTML forms, I generally prefer radio groups over select menus. One advantage select elements have over radio groups is a smaller visual footprint. A long radio list takes up a lot more screen room than a long select list. One way to make a radio list more efficient is to break it up into [...]