Welcome Guest, Not a member yet? Register   Sign In
CI4: Pass Data From Filter to Controller
#2

You can add anything to the Request and it will be available in your controller at $this->request. I think it would be more typical however to have some middleware library that handles the authentication state, and is accessed by both your Filter and Controller. So for example your Filter uses App\Libraries\Authentication::login() and then Controller uses App\Libraries\Authentication::getUser()
Reply


Messages In This Thread
CI4: Pass Data From Filter to Controller - by h4n - 04-10-2021, 04:39 AM
RE: CI4: Pass Data From Filter to Controller - by MGatner - 04-10-2021, 05:43 AM



Theme © iAndrew 2016 - Forum software by © MyBB