Posted by Duncan | Posted in cakePHP | Posted on 14-05-2013
0
This is a short tutorial on how you can create reusable filter links, when you have lists of data that your users may only want to view a specific subset of.

So that this can easily be reused on multiple pages, the best method is to include it in a custom helper. I use a file called GeneralHelper.php for this type of functionality.
Posted by Duncan | Posted in cakePHP, Yahoo! UI | Posted on 08-08-2010
6
When a user signs up to your website, trying to find a username that is not already in use can be a real pain and could cause them not to sign up if they are repeatedly presented with an error. To solve this you can use a simple bit of JavaScript to check if their chosen username is available before submitting their registration.
Posted by Duncan | Posted in cakePHP, Yahoo! UI | Posted on 30-05-2010
5
Something I found out recently when I updated the cakePHP core files, when accessing my 1and1 hosting using ssh I kept getting errors when using the cakePHP console. The problem was caused by the fact that by default 1and1 uses PHP 4 for the command line. This cannot be altered using .htaccess, however after a little googleing I found that using php5 on the command line does as you would expect. So to make your cakePHP console work using PHP 5, all that is needed is a little editing of one file. CORE/console/cake
Change this:
exec php -q ${LIB}cake.php -working "${APP}" "$@"
To this:
exec php5 -q ${LIB}cake.php -working "${APP}" "$@"
All console actions will then be run using PHP 5.
Posted by Duncan | Posted in cakePHP, Yahoo! UI | Posted on 20-05-2010
1
Recently I came across a problem, where I wanted to show a select box for zones in an address (counties or states etc.). I have a list of zones in my database and to put them all in one box would have been unusable as the list is in excess of 2000 zones. My solution to this was only show the zones related to the country selected in another select box. When the user changes the country the zones are updated. In this tutorial I will explain how I achieved this using cakePHP (1.3) and the YUI Library (3.1.1).
Posted by Duncan | Posted in cakePHP | Posted on 21-08-2009
3
I’m sure there are many ways of doing this, but recently I finally got round to figuring out how to update multiple records at a time. When I started out all I wanted was to give all the selected records the same value for one database field, so the first thing we need to know is which records need to be updated and which field. To do this all you need is a list with your records (I’m using portfolios) inside a form with some check boxes and a select box with a list of actions.