Once in a while I run into a situation, where some sort of reporting is required for an application…(It happens.)
An example?.. We need to get a list of all active users in the DB.
I think it happens pretty often, that you need to run some code in a given model’s callback, but only on certain controller actions.
One of many cool CakePHP’s features is the Counter Cache.
From the manual: “This function helps you cache the count of related data. Instead of counting the records manually via find(‘count’), the model itself tracks any addition/deleting towards…
As an addition to my recent post, I wanted to share a technique, which should allow you to pretty easily build a “dashboard” for your app.The dashboard would basically grab some information from a few different models and…
For one reason, or another you might wish to change your Model’s table on the fly…
It would seem that it should be quite easy to do with:
Let’s take a controller ridden with problems and see how we can improve it. Hopefully this little experiment can help you beautify your code and optimize your app…
(Part 2 is here)
I would like to provide some insight on how to use the saveAll() method, with a few real-world examples. First, I’m going to cover how to use saveAll() when working with two…
Part 1. The basics
HABTM seems to give a lot of people trouble, so I wanted to cover a few points that may or may not be in the manual. And I will assume here that you have basic understanding or some knowledge of HABTM…
CakePHP models, unlike super models should be fat. It’s a good practice to keep redundant code out of your controllers. Here’s a quick example on how you can keep your controllers skinny and models fat.