If you find you're writing the same old find($conditions, $fields) time after time, why not encapsulate it as a method on your User model class?
e.g. : User->findMyUserStuff($userId); And you get extra 'DRY' points :) If you're just fetching one field then use $model->field(); ~GreyCells On Apr 7, 8:33 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > when code in cake,I always encounter the situation $this->User- > > >findById('3')['User']['name'] ,something like that. > > but it doesn't work.I know.I used to coding like this :$foo = > $this->User->findById('3'); $foo['User']['name'],but I am really tired of > > that . > > so what really need to be done in php? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---