benedmunds / CodeIgniter-Ion-Auth

Simple and Lightweight Auth System for CodeIgniter
http://benedmunds.com/ion_auth/
MIT License
2.35k stars 1.14k forks source link

Ion Auth 4 Get current user #1502

Closed djphi closed 3 years ago

djphi commented 3 years ago

Hello. Is there a way to get a current user and no need to use $this->data in all function? On ion auth 3 i could use $this->ionAuth->user()->row(); at my template, but not now.

benedmunds commented 3 years ago

You can use $this->ionAuth->user($id)->row() in your controller and then pass through the user data object to your template.

benedmunds commented 3 years ago

Closing due to inactivity. Feel free to re-open if this is still an issue.