CakePHP Tips – Winter 2012

4

Some more tips I gathered the last couple of weeks and want to share with the (Cake/PHP)world 🙂 Jquery and CakePHP FormHelper::radio() Usually you would use var value = $('input[name=fieldName]:checked').val();…Some more tips I gathered the last couple of weeks and…

Saving Model Data and Security

14

In google groups there are quite a few discussions every month about security against (primary key) injection, xss or other things. And yes, the default templates will not protect you…In google groups there are quite a few discussions every month…

How to implement Captchas properly

31

What is a captcha? They protect forms on websites from spammers and bots (@see Wikipedia for details). The main idea: Display some kind of code a human can easily read…What is a captcha? They protect forms on websites from spammers…

Extended core validation rules

2

I18n Translation Some translate the rules in the view – but it usually creates redundancy. In some projects this might be intentional. I like to keep the error messages centralized,…I18n Translation Some translate the rules in the view – but…

Working with forms

4

The Cookbook only covers the real basics. I want to go over some common issues in a more detailed way for Cake1.3 apps. Dummy Values Dummy values for select fields…The Cookbook only covers the real basics. I want to go…

Validating multiple models at once

1

There are forms where you want to add/edit not only fields of the current model, but also of a related one (usually hasMany or belongsTo). Example: User and Post $this->Post->set($this->data);…There are forms where you want to add/edit not only fields…