Hi,

How can I access data within a controller?

Lets say I have the following find() method in my controller

$mydata=$this->User->find('all', array('conditions'=>'new;),
'fields'=>array('name'))

Let's say I wanted to do some sort of proccessing to that data before
outputting to a view.... How would I do that?

I see examples of how to output that data in the view but I see none
about accessing the data from within the controller.

I figure I should do a loop but how should I write $mydata?

Should it be like this:  $mydata['User']['name']  ?  That seems to
work in the view but I get a "Undefined Index" error when I write it
that  way from within the controller.

I don't have the issue when a method returns one record such as field
() because it is not returning an array....

I hope I'm not confusing anyone :(

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to