I’m building a web app using codeigniter 4.0.4. I want to automatically call a javascript function once whenever a certain php variable is set. But I don’t know how to call the function through php or html. The code goes as follows: The javascript function: The php: Answer its working
Tag: codeigniter-4
SQL join codeigniter 4
Codeigniter 4 is throwing the following error: Argument 2 passed to view() must be of the type array, null given called in D:xampphtdocslordeCIappControllersBlog.php on line 35 That is about the block of code below: I am very grateful to who help me with that. Answer First you can remove the first select *, you either select * or define the
CI4 Inserting ID from selected Strings
I’m so tired of thinking how to solve this case. already search by internet and never solved. straight to the point this is my Controller of Product.php this is my Models Model_product.php and this is my Views create.php i want to insert new data from Controller Product function store. i’ve this problem, i cannot change string value into integer value
Undefined database variable
Blog.php code below: blog_index.php code below: I can’t see where is my mistake, it raises a errorException: “Undefined Variable:dados”. About $categorias variable, am learning how to use more than one table per controller. Codeigniter version: 4.0.4 Running through xampp Answer Controller Blog.php View blog_index.php Note :- For Reference see this:- https://codeigniter4.github.io/userguide/outgoing/views.html#adding-dynamic-data-to-the-view
How to use refresh token in codeigniter rest api?
I’m new in codeigniter 4 rest api and oath. I’m able to create login that return the token and the refresh token. My problem is when the token has expired. How can I get new token using the refresh token? Do I have to create a new function in the controller for that? Or can it be the same endpoint
Adding Facebook Library in Codeigniter 4
I am Using CI 4 for my project and I need Facebook Login to get user data which I have done in fb-JS-sdk and after that I save data to DB and start session for that user so It looks like it’s directly loged in by facebook login, but that’s not point here, Now After Login with Facebook user will
How to use renderSection in Codeigniter 4?
From the official documentation of Codeigniter 4 for view layouts there is a function renderSection that you can use at your templates. The main problem though is that I couldn’t figure out how this works. Please have in mind that I don’t want a work-around for this, I really need to know how the renderSection works and what I am
CodeIgniter 4 – How to display Flashdata inside a View?
I’m upgrading my project from CodeIgniter 3 to CodeIgniter 4, I’m trying to display a flashdata message inside a view but unfortunately I get differents error for each method I try. In CodeIgniter 3, I used to call something like: I try the same in CodeIgniter 4 but I get this error: Can any one show me how to achieve
Codeigniter 4 query builder join display only 1 time from first table
I have done up a query builder using join. I would like to show table 2, 3, 4, 5, 6 and so on based on the user id on table 1. I tried to query the result, it is showing like this : My Tables I will be using foreach loop and I believe it will display out multiple times
codeigniter 4 – Controller or its method is not found
it’s running fine when i tested in local server, but when i uploaded 000webhost server to it’s showing an error. an error My Routes: my routes : can anyone helping me? my controller an error i try to hide detail’s method in url, it’s running fine in local server but why it’s showing an error when i uploaded to web