I’m trying to retrieve the user id in a cakephp view, what’s the best practise to achieve that?
since Auth->user('id') is only usable in controller, what’s to be used in views?
Edit :
I fixed it by using this in the controller:
$id = $this->Auth->user('id');
$this->set("user_id",$id);
then in the view of the controller I just retrieve $user_id.
Use the Session helper.