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
Tag: codeigniter-4
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
How to use if elseif inside table row without making a new row?
I want to make a code that can use if else if inside table row. But I can’t make it ,once I use else if statement inside table row it make a new row by it self. I expect that it make a new column in the same row Here’s a code as you can see what I expected is
DOMPdf not generating PDF on production server, only showing code
I have a working DOMPdf generation from HTML on a local server. I uploaded it to my production server and from my first tests it seemed to be working. Now a couple of days ago I started receiving reports that the PDF generation only shows symbols and letters. So, I checked and did some testing and apparently the issue is
Searching by name and date between codeigniter 4
Hello everyone I’m creating report through the fetched data, I created search based on category, amount and date between. But the problem is that, If I entered category and trigger the search button I get the data, And If I set the dates between to range it aslo returning the data. But if I set both category and dates between
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
Parameter passing through routing problem in Codeigniter 4
I have a little routing problem, that i can’t solve in Codeigniter 4. I try adding a parameter at deleting list item. But get the following error messages. Error message at post routing: Controller …
How to paginate with ajax using pager library in codeigniter 4
hellow everyone, I am creating ajax pagination with CI4 Pager library, but I found it difficult to catch id of the pagination counter. instead of using full URI path like “localhost/view-user/?page=1”, I want to be able to catch only “1” so I can pass it using javascript as post variable that will allow me to path inside paginate method as
CI4 on live server not reflecting changes made, it shows old data. Dynamic contents and other changes are not reflected
I created a website using CI4 and it was working fine. On WAMP server it’s working fine. Now if change anything and update the server it shows the old data and session not working properly sometime. I think browser is caching the webpage. Is there any way to disable in CI4? Is it cache issue or session? “Old data” means