I have forgotten more than I'll ever know
Accessing user_id in CakePHP
Add this to the model
class Foo extends AppModel { var $currentUsrId = NULL; }
Then add this to the controller
class FooController extends AppController { function beforeFilter(){ parent::beforeFilter(); $this->Foo->;currentUsrId = $this->;Auth->user('id'); } }
Print article | This entry was posted by Twitter on February 8, 2011 at 11:48 am, and is filed under CakePHP. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |