Can not declare session check in contractor in ci4 |
I was trying to protect full controller class from non authorize user so I use
PHP Code: if(! session()->has('isLogged')) Buh will not work untill I put that same code in each method before it effect. Any way to make it for the whole controller?
Sounds like you're looking for a before filter - https://codeigniter4.github.io/userguide...lters.html
(03-31-2020, 04:25 AM)maxxd Wrote: Sounds like you're looking for a before filter - https://codeigniter4.github.io/userguide...lters.html That save my day. A big Thank you. |
Welcome Guest, Not a member yet? Register Sign In |