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
4
votes
2 answers

PHP CodeIgniter 4 - Form Submission - error "Can't find a route for 'registrations/index'"

I'm using the form_open() helper method within the view to indicate the controller method to handle the form submission action and have the route defined in app\Config\Routes.php. I'm still getting an error Can't find a route for…
Siva
  • 61
  • 1
  • 1
  • 3
4
votes
4 answers

Codeigniter 4 composer update PHP Fatal error: Uncaught Error: Call to a member function run() on int in index.php

I just updated my Codeigniter 4 site from 4.1 to 4.2 using composer and am now getting the following server error in the Apache error log: PHP Fatal error: Uncaught Error: Call to a member function run() on int in…
webmaster_sean
  • 942
  • 4
  • 13
  • 23
4
votes
5 answers

CodeIgniter 4 Filter - exit with response

I have a project with CodeIgniter 4. I have a before filter: public function before(RequestInterface $request){ $auth = $request->getHeader("Authorization"); if($auth == null){ $response = Services::response(); …
KunLun
  • 3,109
  • 3
  • 18
  • 65
4
votes
4 answers

Can't send server emails in CodeIgniter 4

I just hanged up to send server emails. I'm preparing email sending code like this: $email_config = Array( 'charset' => 'utf-8', 'mailType' => 'html' ); $email =…
Encrypted
  • 628
  • 1
  • 10
  • 22
4
votes
15 answers

Debug Toolbar in Codeigniter 4 not working

I installed Codeigniter 4.0.2 and did following changes: 1- CI_ENVIRONMENT = development in .env file 2- SetEnv CI_ENVIRONMENT development in .htaccess in public folder 3- Added $useKint = true; in main index.php file in public folder When I open at…
MyO
  • 413
  • 1
  • 8
  • 19
4
votes
2 answers

Codeigniter 4 deployment to apache2

I've been trying to deploy my codeigniter 4 app into a local apache server. I want to be able to access my app through http://localhost/my_app/. I've set up the url in the .env file: app.baseURL = 'http://localhost/my_app' Edited the .htaccess…
AusiasMart
  • 53
  • 1
  • 5
4
votes
5 answers

why Whoops! error showing in codeigniter-4

i just copy codeingiter 4 in my XAMPP for Linux 7.4.3 which have PHP Version 7.4.3 but getting error like Whoops! We seem to have hit a snag. Please try again later...
Muhammad Farhan
  • 55
  • 1
  • 1
  • 5
4
votes
1 answer

How to use ajax in codeigniter 4

I am using codeigniter-4 version and trying to auto search in nav bar. I'm trying to send data in post method into controller using ajax. But its not work. And codeigniter 4 don't described details for ajax. below my code sample input box is…
Shahadat
  • 151
  • 2
  • 3
  • 14
3
votes
0 answers

Flarum SSO with CodeIgniter

I'm trying to build out the requirements for the Flarum SSO PHP plugin with CodeIgniter as the SSO provider, and I feel like I'm really close - but it just doesn't quite work. I can see that the credentials pass to Flarum on user login, but when…
James
  • 834
  • 7
  • 27
3
votes
5 answers

Best practice when sanitizing HTML form user input in PHP / CodeIgniter 4

I have a simple app programmed in PHP using CodeIgniter 4 framework and, as a web application, it has some HTML forms for user input. I am doing two things: In my Views, all variables from the database that come from user input are sanitized using…
user1314836
  • 219
  • 1
  • 4
  • 14
3
votes
1 answer

Codeigniter 4 - REST with Auto Routing improved

I have a controller App/Controllers/Api/Orders.php
user64675
  • 482
  • 7
  • 25
3
votes
2 answers

How to fix 'Cannot access the default controller' using Codeigniter 4.2.6?

I have a problem working with URI routing in Codeigniter 4.2.6. I have Controller name Home and a method name getIndex. When accessing http://localhost:8080 all working fine. When I try http://localhost:8080/home/index, a message 'Cannot access the…
MSI
  • 165
  • 10
3
votes
4 answers

Getting error "CodeIgniter\Cache\Exceptions\CacheException Cache unable to write to ... " for a new Codeigniter 4 project

Almost always, when I am starting a Codeigniter 4 project, I am getting the following error: "CodeIgniter\Cache\Exceptions\CacheException Cache unable to write to…
John Skoumbourdis
  • 3,041
  • 28
  • 34
3
votes
1 answer

Custom .env variable on Codeigniter 4

Normally if i want to change the database hostname in CI4 project i will change it in .env file and change the database.default.hostname = localhost but now i need to use MYSQL_HOST in env to change the hostname like so MYSQL_HOST = localhost can i…
3
votes
0 answers

Codeigniter Version 4.1.7 Rest API Routing Post method not working

I am using Codeigniter Version 4.1.7. Where I am implementing Rest API. In the routes the GET method works,however Post method is not working. I am testing this using POSTMAN. URL : http://localhost/myproject/api/add-user Following is the…
Ruprit
  • 733
  • 1
  • 6
  • 23
1
2
3
82 83