helper |
Hello
I am new to codeginiter4 I cannot see the controller that I am currently in from a helper. In codeigniter3 I used: $ CI = & get_instance (); $ CI-> router-> class; $ CI-> router-> method; I don't know how to do it in codeigniter4 Thanks!
It would help if you tell us what it is you want to do not how you use to do it.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(12-03-2020, 02:56 AM)Llui7 Wrote: Hello This is easier to do in CI4. You just have to learn about namespaces. See this forum thread for more details.
This is easy in CodeIgniter 4
PHP Code: $router = service('router'); All most all CodeIgniter 4 Core Classes are invoked by a service. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(12-03-2020, 05:06 PM)InsiteFX Wrote: This is easy in CodeIgniter 4 Wow it's very simple thank you InsiteFX!! (12-03-2020, 06:51 AM)sammyskills Wrote:(12-03-2020, 02:56 AM)Llui7 Wrote: Hello Thanks for the information!! i will read about namespaces |
Welcome Guest, Not a member yet? Register Sign In |