Thanks ! The link gives a nice pragmatic solution (although not fully MVC-compliant:)
So, there's no way to access a controller in the model, right ? Spark On Jan 15, 2008 4:36 PM, rtconner <[EMAIL PROTECTED]> wrote: > > This blog post might be worth your time. > http://www.ad7six.com/MiBlog/TrackWhoMakesDBChanges > > > On Jan 15, 12:21 pm, "DJ Spark" <[EMAIL PROTECTED]> wrote: > > Hi, > > > > Every model in my project does have a 'created_by' and 'modified_by' > > field, storing some user ID. > > Currently, I'm using a controller beforeFilter to populate a > > temporary Model with the $this->Auth->user() , only if $this->data is > > full of something, and a beforeSave in the Model, to associate that > > temporary fields to the model being saved. > > Actually, I don't quite like this approach, but couldn't think of > > something better, since a Model can't access the Auth component. Or > > could it ? > > Is there a better way to write it ? > > > > thanks > > Spark > > > > -- > > [livesets]http://djspark.com.br/ > > [web]http://sydi.net > > [filmes]http://melhoresfilmes.com.br > > > -- [livesets] http://djspark.com.br/ [web] http://sydi.net [filmes] http://melhoresfilmes.com.br --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
