Welcome Guest, Not a member yet? Register   Sign In
CI3 to CI4 Migrations (__construct)
#9

(05-10-2019, 12:12 AM)Avega Soft Wrote:
(05-08-2019, 07:05 AM)kilishan Wrote:
(05-07-2019, 09:02 PM)Avega Soft Wrote:
(04-16-2019, 06:42 AM)kilishan Wrote: You can definitely use the constructor for almost anything you need to. It was purposefully left blank so framework code didn't get in the way of what you needed.

However, redirects no longer work from within constructors. Instead, you should look at controller filters for permission checks and the like.

If I am right understanding the Controller Filters starting working before apps controllers and check url's or form action type as hooks in CI3 ?

Controller filters will be ran either just before running the controller method, or just after. There are still "hooks" in CI4 similar to what you're used to in CI3, but they've been renamed to "Events" now and made more flexible.

https://codeigniter4.github.io/CodeIgnit...vents.html



how did you share the code sample
Reply


Messages In This Thread
RE: CI3 to CI4 Migrations (__construct) - by ysarsilmaz - 07-20-2020, 02:19 AM



Theme © iAndrew 2016 - Forum software by © MyBB