Archive for the ‘Code Case’ Category

Php Input Validation

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 [...]

CakePhp: Custom Pagination Methods

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 [...]

CakePhp: Radio Select Columns

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 [...]