Good afternoon! I have a view (rates/index.ctp) that displays data from my model (models/rate.php). I make a small edit to the data before I send it to the view, as below:
function afterFind($results) { foreach ($results as $key => $val) { if($val['Rate']['daily'] <= 0) { $results[$key]['Rate']['daily'] = "Not Available"; } else { $results[$key]['Rate']['daily'] = $results[$key]['Rate'] ['daily']; } } return $results; } For some reason this gives me the following notice on index.ctp: Undefined index: Rate [APP\models\rate.php, line 16] (line 16 is "if($val['Rate']['daily'] <= 0) {" ) The logic in the afterFind callback works exactly the way it's supposed to, and 'Not Available' shows up where the value of daily is 0, so there's clearly not an actual problem with the assignment. But still, the notice... What is Cake trying to tell me? Thanks for any help :) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---