CakePHP: createdBy and updatedBy field
Trying to create a 'magic' field开发者_运维百科 like the created and modified field in CakePHP, but instead of storing a timestamp, I want a username that submitted the request.
Is there a way to pull in AuthComponent into the model, or do I need to do some magic with the AppController and always put a username field in the $this->data array?
This behavior is available that logs who created or modified a model record. http://bakery.cakephp.org/articles/danfreak/2009/03/01/whodidit-behavior-automagic-created_by-and-modified_by-fields
If you don't wish to use it directly, it could serve as a reference for your own work.
精彩评论