$name = $numberfour["MyModel"]["fullname"]; Try doing: print_r($numberfour)
-- Pablo Viojo [EMAIL PROTECTED] http://pviojo.net On 7/20/07, youthoftoday <[EMAIL PROTECTED]> wrote: > > > I'm new to cakePHP, but experienced with Rails. I can't find the > answer to the following anywhere. > > Let's say I have a model for which I've defined a custom function, for > example one that joins concatenates two fields. I retrieve this object > from the database and I want to call a method. For instance: > > $bob = new MyModel; > $numberfour = $bob->findById(4); > $name = $numberfour->fullname(); > > The last line doesn't work, and says "Call to a member function ____ > on a non-object". In Rails the returned results would be objects, but > in cake they seem to just be an array? > > So how do I call methods/functions on returned models? > > Thanks very much! > > Joe > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~----------~----~----~----~------~----~------~--~---
