Working with Filters Problem, Globals works Filters does not work - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Working with Filters Problem, Globals works Filters does not work (/showthread.php?tid=75983) |
Working with Filters Problem, Globals works Filters does not work - anmar_dev - 04-03-2020 Hi everyone, Ok her is the issue i been trying to implement filter to check session of user is logged in or not. App\Filters\AuthFilter.php PHP Code: <?php namespace App\Filters; Fair enough. simple and direct from the UserGuide. Now on config directory App/Config/Filters.php PHP Code: <?php namespace Config; and for my controller App/Controllers/Account.php PHP Code: <?php namespace App\Controllers; Ok here is the thing When i make the filter global like the file currently it works. However when i deactivate $globals and activate $Filters IS JUST DOES NOT WORK! I really confused. And a small note if you don't mind me say. CodeIgniter4 Documentation is no more for beginners or php beginners like CI2 and CI3. It meant to be understood by a people who really have a good grasp of OOP and OOD patterns. No offence intended. RE: Working with Filters Problem, Globals works Filters does not work - anmar_dev - 04-03-2020 Ok i further tried debugging my code. here is what i found It seems when i use any other method (Besides index and __cunstruct) the filter works... Please could someone elaborate to my why? why it behaves like this? |