![]() |
Urgent: Pass data from filters to controllers - 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: Urgent: Pass data from filters to controllers (/showthread.php?tid=84147) |
Urgent: Pass data from filters to controllers - Mojito - 10-15-2022 Hello, I'm creating a restapi using jwt authentication. I'm decoding Jwt hashes in my auth filter like that: PHP Code: public function before(RequestInterface $request, $arguments = null) And the goal is to pass $user_id variable from the filter to the controller What is the best way to do it? RE: Urgent: Pass data from filters to controllers - plaztic - 10-16-2022 Create a Constant. RE: Urgent: Pass data from filters to controllers - kenjis - 10-16-2022 It seems better to set the user_id to Request object, but there is no good way to do so. RE: Urgent: Pass data from filters to controllers - Mojito - 10-16-2022 (10-16-2022, 02:49 PM)kenjis Wrote: It seems better to set the user_id to Request object, but there is no good way to do so. yes what i did as i didn't found other solution! |