Saving extra fields in the join table (for HABTM models)

An interesting question came up on IRC today, which essentially boils down to: “How to save extra fields in the

Read more

SELECT … AS … in CakePHP 1.2

This is a simple hint, but hopefully will be useful to some… You might have noticed some examples where you

Read more

Food for thought: $this->redirect() vs $this->render()

One example, that we often see, is something along the following lines in the controller: if($this->User->save($this->data)) {   $this->Session->setFlash(… some

Read more

Food for thought: $this->redirect() vs $this->render()

One example, that we often see, is something along the following lines in the controller: if($this->User->save($this->data)) {   $this->Session->setFlash(… some

Read more

Set::merge() and dynamic validation rules

Here’s another trick with Set::merge()… Let’s say we’ve defined some basic validation rules in our Profile model, something like: var

Read more
%d bloggers like this: