In earlier versions of CakePHP we had to use Behaviors like "MultipleDisplayFields" or whatever. With $Model->virtualFields it is now possible to natively use find() methods combined with virtual fields. The nice thing about it is, that the pagination can work…
Author: Mark
Maximum power for your validation rules
I already postet an article about custom validation rules some time ago here. In this post I introduce some of my custom rules which come in handy quite often. For being able to use it in different projects I do…
Common CakePHP problems and solutions
Some questions are asked more often than others. The following I have read a thousand times. Maybe it’s time for some of those to be answered in detail. Editing own account/profile If you want users to allow editing their own…
Working with passwords in CakePHP
The basics Usually, this is already well known. But.. there are still developers who actually store the password unhashed. You always have to store user passwords hashed. You can either use the still very common sha1 method (which is the…
Gravatar CakePHP Helper
An independent Avatar-Generator 90% of all blogs out there use gravatar. Therefore you can easily use it with most of your users’ email addresses. But even if you don’t want your users to use their gravatar image you can still…
Forms and redirecting
Redirecting in your CakePHP app My CommonComponent now contains three redirecting methods: /** * @param mixed $url * @param bool $useReferer * returns nothing and automatically redirects * 2010-11-06 ms */ public function autoRedirect($whereTo, $useReferer = true) { if ($useReferer…
Useful CakePHP shell scripts
Today I want to present some useful shell scripts I often use. Hopefully you find them useful, as well 🙂 Where to put them Drop shells in a vendor folder of your choice (either app, core, or plugin), for instance:…
Bitcoins and CakePHP
When I started to try this out with a friend I was surprised how few resources there are. Especially in the CakePHP sector. Bitcoins are not very common yet – although quite promising: anonymous, not refundable payments without any transaction…
Introducing two CakePHP behaviors
Today I want to introduce two new CakePHP behaviors. Jsonable Behavior This is not so new, of course. Already existed as a basic version in the Bakery. I enhanced it to work with more than just plain arrays and added…