Following the manual: http://book.cakephp.org/1.2/view/816/counterCache-Cache-your-count
I have this code in my model:
class Ticket extends AppModel {
var $belongsTo = array(
'TicketStatus' => array('counterCache' => true)
);
and this from my view/index.ctp:
echo $ticket_count
but it errors out instead of printing the content of that field. I’ve already added ticket_count (INT) to my tickets table. What have I missed?
Thanks
Lyman
Did you set the $pending variable to be used in the view?
Then is yout view: