Welcome Guest, Not a member yet? Register   Sign In
Get select for all controllers
#4

It’s still not clear what you try to do. What does it mean “I want to add it to only one file and it applies to all functions”? If you create a function in your base controller and your controllers extends the base controller, then the function will be available from all controller. But you will still need to call it. Or maybe you just want the result of that query available from all controller. Then execute that query in initController of the base controller and store the result in a public or protected variable.
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply


Messages In This Thread
Get select for all controllers - by Secux - 10-10-2021, 09:36 PM
RE: Get select for all controllers - by Secux - 10-12-2021, 11:23 PM
RE: Get select for all controllers - by includebeer - 10-13-2021, 08:04 AM
RE: Get select for all controllers - by kilishan - 10-13-2021, 11:23 AM



Theme © iAndrew 2016 - Forum software by © MyBB