Questions tagged [codeigniter-4]

CodeIgniter 4.x is the latest major version tree of the popular PHP-based framework. CodeIgniter is an Application Development Framework - a toolkit - primarily for people who build websites using PHP. Please refer to the [codeigniter] tag for more information.

CodeIgniter 4.0.3 is the latest release, targeted for PHP7+ only and is not intended to be backwards-compatible with previous CodeIgniter versions.


What is CodeIgniter?

CodeIgniter is an Application Development Framework - a toolkit - for people who build websites using PHP. Its goal is to enable you to develop projects much faster than you could if you were writing code from scratch by providing a rich set of libraries for commonly needed tasks, as well as a simple interface and logical structure to access these libraries. CodeIgniter lets you creatively focus on your project by minimizing the amount of code needed for a given task.

Codeigniter 4.x is the latest major version tree of the framework. The project (originally from EllisLab) has been completely rewritten and is maintained on GitHub by the British Columbia Institute of Technology.


Please refer to the tag for more information.

1234 questions
3
votes
1 answer

Does PHP sleep() function allow to free the main thread for a specified amount of seconds?

I have a web application that allows the users to upload DBF files and the app will store contents into an SQL database. The row count range from a few thousands to about 80,000 rows and I have the following code if($file){ $totalRows =…
Nathan
  • 163
  • 10
3
votes
1 answer

Codeigniter 4 Validation for optional values

How to validate optional values in codeigniter 4 for example conditions If one field is filled by user which is an optional If one field is left empty by user which is an optional how should I validate in first condition This is my model code…
WebRTClerni
  • 149
  • 1
  • 8
3
votes
2 answers

How to use table alias in codeigniter 4?

I'm trying to join religions and citizen tables inside the CitizenModel. The problem is the from statement always includes the table citizen. Here's the sample Model script:
unice
  • 2,655
  • 5
  • 43
  • 78
3
votes
1 answer

Writing SQL subquery with CI4 active record

I'm struggling to write my sql statement with subquery in Codeigniter 4 with active record. SQL SELECT p.id, p.catId, p.image, c.id, (c.name) as category FROM product_feature p JOIN categories c ON p.catId = c.id WHERE p.id IN( SELECT…
ven
  • 185
  • 1
  • 18
3
votes
2 answers

Remove CI4 public/index.php with .htaccess rewrite rule on subdomain/folder

I have a subdomain called test.mysite.com and I have a CI4 installation inside a folder there called project. So the actual url for the CI4 installation is test.mysite.com/project/public/index.php. I want to remove the public/index.php portion from…
FilT
  • 192
  • 4
  • 13
3
votes
1 answer

Codeigniter 4 Model Relationship Entity

I have database tables that look like this : Table 1 : transaction id|buyer_id|transaction_date ---------------------------- 1 | 1 |2020-01-01 2 | 4 |2020-03-04 3 | 6 |2020-11-12 ---------------------------- Table 2 :…
Ajabkali Maha
  • 43
  • 1
  • 4
3
votes
1 answer

mysqli_sql_exception unknown column in codeigniter when using findAll()

I am learning CodeIgniter4, and i got stuck while using function findAll(), it says this: mysqli_sql_exception #1054 Unknown column 'cursos.deleted_at' in 'where clause'
devCcori
  • 43
  • 1
  • 5
3
votes
1 answer

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…
Cypher or KJ
  • 51
  • 2
  • 16
3
votes
1 answer

CodeIgniter 4 Models->find()

i'm so sorry if this question already asked before, so what i'm trying to do is to get result like this from my models $data = $userModel->where('username', 'myname')->find(); my expectation : $data = [ 'id' => 1, 'username' => 'myname', …
Bharga Wiguna
  • 43
  • 1
  • 1
  • 7
3
votes
6 answers

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:
Félix Maroy
  • 1,389
  • 2
  • 16
  • 21
3
votes
1 answer

ErrorException Trying to get property 'kode_buyer' of non-object

Im trying to populate my dropdown with data from my database Heres my Model : public function getBuyer($slug = false) { if ($slug == false) { return $this->findAll(); } return $this->where(['kode_divisi' =>…
Sukma Qintara
  • 69
  • 1
  • 6
3
votes
3 answers

Integrate Twig with CodeIgniter 4

I used Twig with Symfony and I really loved it. I now have a CodeIgniter project and I want to integrate Twig with it. I installed the latest versions of CodeIgniter and Twig via Composer and and followed this tutorial but I believe the code in the…
Jolan
  • 681
  • 12
  • 39
3
votes
1 answer

How to turn off the new codeigniter 4 error reporting

Is there a way to turn off the fancy error reporting in Codeigniter 4? I prefer the classic way.
Dusan
  • 3,284
  • 6
  • 25
  • 46
3
votes
6 answers

Decrypt showing error authentication failed

I am using codeigniter 4. Why is my code showing error when I'm trying to encrypt my URL ID in view? view:
Suhari Adi
  • 51
  • 1
  • 10
3
votes
4 answers

CORS issue in codeigniter 4: Response to preflight request doesn't pass access control check

I'm making an api with Codeigniter 4 for a react application. Everything works fine in postman but when I make requests with axios (also tried fetch), it gets CORS error Access to XMLHttpRequest at 'http://localhost:8080/testpost' from origin…
eminsh
  • 233
  • 1
  • 2
  • 9
1 2
3
82 83