Bake yourself a complete admin backend - in one call
24 Mar 2008
Happy Christmas leveille!
How would you like to be able to generate your entire admin backend in one call? Not interesting enough? How about with built in index filters and by writing practically no code? Well... keep reading then :).
The code
The code I am discussing here is available from the Noswad cakeforge project. Be sure to read the release note.
...
Ego v Benefit
19 Feb 2008
As many will now know the Cookbook for CakePHP is now live. Coupled with the Bakery that should mean that documentation, and finding info regarding cake, just got a whole lot easier. These two applications now mean that the scope for this blog is reduced to things that I don't deem either book worthy (not documenting how to use something) or bakery worthy (useful info that is...
Visualize your models
26 Jan 2008
Happy new year!
Way back in December I found an awesome article by Cakeexplorer on a script to build an image of your db schema. I had been meaning to write such a script for some time, it was great to have it already ticked off the to-do list.
There was one thing that I didn't like too much: it ran off the tables in the db rather than the models in your app/models...
Speed up your dev: write custom bake templates
28 Nov 2007
When I first started using cake, bake wasn't around. It took quite some time for me to decide to give it a go, but at that time what bake gave wasn't customizable, as such it's use was limited since it took nearly as much time to bake and edit the files as it did to just write the files (once you know what you are doing that is). Roll the clock forward a bit and bake ...
DRY: Applied to your setup
20 Nov 2007
As pointed out in a recent comment, when changing your cake version you may find that some of your hand written config files are nolonger compatible with the version of cake you have selected. However by making use of a a custom production setup there is a way to configure your application defensively and in less lines of code.
Every time I use copy, paste &...
read populates $model->data
02 Nov 2007
For the past couple of days, I've had this niggling doubt that I've been missing something. Some code that I had in a behavior, which was supposed to be triggering a save for two field values, further down the line kept turning into a save which included every field in the table with the old field values. Why was this happening? I asked Elvis, he didn't know so I had to ...
Automatically track who makes Database changes
19 Sep 2007
You may well find that you want to automatically know which user is adding or updating your database info. There are a few ways to do this and I recently, inadvertently, let slip that I have a whoDunnit (who did it) behavior which I use for exactly this purpose.
I wasn't sure if I should make it public; trouble is a little knowledge is a dangerous thing, and the...
Generic File Upload Behavior
14 Sep 2007
On a recent project I had to address the requirement that the admin user can "upload any type of file and associate it with any of the models in the system". In reality this seems to be a rather logical and common requirement. For quite a while now I've been collecting bits of info on how to upload files with cake and it's about time to begin sharing the knowledge. Did I say ...