Category Archives: CakePHP

CakePHP Code Snippet: Return only fields with values to the DB upon saving.

This code goes in {ModelName}::beforeSave: foreach ($this->data[$this->name] as $key => $value) { if (!set::classicExtract($this->data,$this->name . ‘.’ . $key)) { $this->data = set::remove($this->data,$this->name . ‘.’ . $key); } } I use it where the DB may be expecting values for certain … Continue reading

Posted in CakePHP | Leave a comment

CakePHP

If, like me, you’re not a real PHP aficionado, you can use CakePHP to fast-track application development. Using CakePHP still requires a modicum of PHP know-how, but this can help you learn about MVC and OO PHP. I had a … Continue reading

Posted in CakePHP, PHP | Leave a comment