Return of the Demos
24 Sep 2006
A brief not to say that I'll be putting a couple of Demos back on the site, and I'll be adding to the main demo page as I go. All of the demos will be put up as plugins.
The pagination demo and source has always been available, and adding to that, the the next example is the Title tutorial. A very simple example based on the original tutorial from the wiki...
Change the config at run time
18 Sep 2006
Following on from my previous post, I thought I'd mention a similar use that can make a developers life a little easier. Usually when developing software there are at least 3 environments: Development, Test and Production. For larger projects there may be more, but for a simple website (and a tiny team of 1) there is often 2 environments: the one on the development machine...
One Database file - two servers
16 Sep 2006
If you have your website on one server for testing/development (like this laptop) and your live site on another, it's quite likely that once in a while your database.php file from one or the other will find itself referring to the wrong database. Over at With Cake a solution was proposed to allow you to switch database sources in the app model, however it might be easier to...
Prevent Robots from accessing an action
11 Sep 2006
If, like on this site, you have some demo applications with some data in them, it's wise to try to ensure that the test data you spent an hour or two creating doesn't get deleted.
For the demos that were on this site (they'll be coming back after some tweaking) I set up a script to run once per hour to truncate and reimport the test data - thus ensuring that malicious...
The power of logs
07 Sep 2006
One of the changes I made to my site recently, was to override the App Error Function to keep track of how things are going wrong. I did this by simply logging all the information available and redirecting the user to a safe page (the home page).
I've found this to be very useful in general, especially for debugging what was going wrong with multiple inter-plugin...
Plugins and Routes
05 Sep 2006
Routes are a great feature, but if you try using them with Plugins you might find that you start pulling your hair out. Fear not however, there's always a solution and it's usually not that difficult. If you use routes of the form below, you can map directly to a plugin's page:
$Route->connect('/Something/*', array('controller' => 'PluginName', 'action' => 'ControllerName',...$Route->connect('/Something/*', array('controller' =>'PluginName', 'action' => 'ControllerName',...
CakePHP Quick Tips
05 Sep 2006
Quite often the question is asked "How can I access XYZ in my controller/view/model etc?". IMO this question rarely needs to be asked ;).
Using the following simple approach should empower you to answer most questions:
- Set DEBUG to 2 in your /app/config/core.php file so you can see the executed SQL whilst you are developing, you can set it to 3 to see a dump of the...
To Bidet or not to B'Day
05 Sep 2006
The singer Beyonce