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
2
votes
1 answer

Codeigniter 4 query builder join 2 or more tables without duplicate result

I have done up a query builder using join with the following setup: My Tables Table users user_id | username | email 1 | userA | userA@email.com 2 | userB | userB@gmail.com …
Dr3am3rz
  • 523
  • 1
  • 13
  • 41
2
votes
3 answers

CodeIgniter 4 plus Myth/Auth throws error when running Migrations via php spark migrate -all

I have discovered some wired behavior, I have that one CI4 project i am working on since a couple of weeks. everything is working just fine, but until now i have just been working with the project on my local machine. When i wanted to run the…
Tristano
  • 21
  • 1
  • 6
2
votes
1 answer

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 Table users user_id | username | email 1 …
Dr3am3rz
  • 523
  • 1
  • 13
  • 41
2
votes
3 answers

Codeigniter redirect()->to() doesnt work in __construct()

I have code in my controller public function __construct() { return redirect()->to('/auth'); $this->validation = \Config\Services::validation(); $this->title = 'Header Menu'; $this->controller = 'user'; } public function index() { …
2
votes
1 answer

How to pass a any numbers of parameters in ci4 routing?

I trying to find a solution to pass a any number of parameter using route. As an example, if my route is $routes->get('pages/section/widgets/(:num)/(:num)/(:num)', 'Section::widgets/$1/$2/$3'); Here I have to promptly declare number of parameters I…
Abhishek Honrao
  • 780
  • 5
  • 28
2
votes
1 answer

Join three table codeigniter 4

Hi everyone i'am new on codeigniter 4 and currently working on a small project in the project i'am trying to join three tables and display there data in single table. Table_1 id unique_id Name 1 1111 Sam 2 2222 Charlote Table_2 id…
dhannyjsb
  • 23
  • 1
  • 1
  • 5
2
votes
1 answer

How do nested variables within the .env file work in CodeIgniter 4

Under the "Nesting Variables" section in Codeigniter4 site: "To save on typing, you can reuse variables that you’ve already specified in the file by wrapping the variable name within ${...}" link to CI nesting Variables section example in the…
dozor
  • 25
  • 1
  • 5
2
votes
1 answer

CodeIgniter 4 : spark with multi public folders

I'm developing websites with new CodeIgniter 4 (I used CodeIgniter 3) and I have a problem: I use multi public folders to run multi websites on 1 CodeIgniter system like: public/site1/index.php public/site2/index.php etc. in index.php (which is…
Guillaume
  • 113
  • 6
2
votes
4 answers

Codeigniter 4 cookies issue not able to set

This is my controller code. I am not able to set and get the cookies in Codeigniter 4. helper('cookie'); $this->response->set_cookie('forgetpwd',$token, time() + (3600),"/",site_url()); print_r($this->request->get_cookie('forgetpwd')); die();
pal
  • 31
  • 1
  • 4
2
votes
3 answers

Codeigniter: Unknown column 'stud.id' in 'where clause'

I encounter the error "Unknown column 'stud.id' in 'where clause'. I don't have any stud.id in my files and also in my database. What do you think the problem with this? I'm using Codeigniter 4. Below is my code on my Controller: $model = new…
cjvdg
  • 497
  • 2
  • 15
2
votes
1 answer

Codeigniter 4 subdirectory controller not accessible on remote server

I just almost completed project in Codeigniter 4 and published it on hosting server. And now I am not able to access controller that is inside subdirectory. For example: http://localhost/admin/auth/ - this URL works fine. And when I access it on…
Skyyy
  • 1,539
  • 2
  • 23
  • 60
2
votes
5 answers

How to Custom 404 Page Not Found in CodeIgniter 4

I just learn CodeIgniter 4 Framework. How to customize my 404 page not found?
Christianto
  • 47
  • 1
  • 5
2
votes
1 answer

Codeigniter 4 - call method from another controller

How to call "functionA" from "ClassA" in "functionB" inside "ClassB" ? class Base extends BaseController { public function header() { echo view('common/header'); echo view('common/header-nav'); } } class Example extends…
kyob
  • 35
  • 2
  • 7
2
votes
2 answers

Codeigniter 4: Uploading files with move_uploaded_file

I just started moving CodeIgniter 3 project to CodeIgniter 4. Everything works fine except file upload. I would like to keep the user uploaded files in /writable/uploads. Below is the code I use to move the uploaded file to desired location. …
arun kumar
  • 703
  • 2
  • 13
  • 33
2
votes
0 answers

Pagination custom url in codeigniter-4

I created a method in a model of CI4 to query a search results. I need to paginate search results but the URL not provide results. I need to standard way for pagination in CI4. Here is model method -
Shahadat
  • 151
  • 2
  • 3
  • 14