Skip to content
Advertisement

Tag: codeigniter-4

Load View in Custom Helper Codeigniter 4

In CI 3 i can load view file in helper like this. But in CI 4, when i use this function in my custom helper, it shows following error. Call to undefined function get_instance() How can i load view file in helper in CI 4 ? Answer There’s no need for any of that. In codeigniter 4 all you need

I’m facing this error Cannot use object of type mysqli as array

Controoler: view: I’m facing this error Cannot use object of type mysqli as array How can solve this problem. Answer Change the controller to this: Basically in your case you’re sending to the view the query object and not the query result. This answer assumes that you’re using the codeigniter 4 Model and not a custom model since you didn’t

Module view file showing invalid in Codeigniter 4

I’ve added the module folder in …appConfigAutoload.php My directory: Routes.php Blog.php After running my_domain/index.php/blog, it’s showing this error: Didn’t get any solution from this one: Codeigniter 4 View file invalid Where am I wrong? Answer Changing Blog.php to this, worked for me. Credit: CI Forum

Connecting Database Codeigniter 4 With Custom Ports

So, I’m trying to connect to my database container from my webserver container. I currently use Codeignter 4 for my PHP framework. Everything goes well in terms of communicating between different containers because that container is inside the same networks. Inside webserver container, I’ve tried to ping from and to database container with no problem, All the port is accessible

Advertisement