I've got a quick question about this - Let's say I have a Model for User, which has a firstname and lastname. Let's say that I want a method that will take data for an instance of hte model, and produce a full name (i.e., return $data['User']['firstname'] .' '. $data['User']['lastname'];, more-or- less).
It seems like it makes sense to put the FullName method on the Model (i.e., in the User class), even if I want to make use of it in an AppHelper (or some other view). I don't want to query/modify/delete anything in the DB, I just want to get access to this helper method. Is this 'MVC kosher'? Is there a better way to do this? Thanks! --Mike On May 13, 1:23 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > If Iuse& ClassRegistry::getInstance(); in thehelperthemodelis > present. > If Iuse$Model=& ClassRegistry::getObject('ModelName'); I get that > $Model=null > > On 13 Mag, 10:17, grigri <[EMAIL PROTECTED]> wrote: > > > > > > Only it works for somemodeland for other it doesn't work. > > > Why? > > > It will only work for models that are already loaded and registered. > > If you need amodelthat hasn't been loaded, you'll have touse > > App::import() to load it first.- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---