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
1
vote
0 answers

Codeigniter 4 routing error with namespace contains number

I use CodeIgniter 4 latest version. And i want a route for example Controllers/1_0/Users.php But if i try use Users.php namespace to app\Controllers\1_0, i receive error. Is have solution or not? Best regards. My routes: $routes->get('user/login',…
1
vote
0 answers

Codeigniter 4 sum many columns in multiple join table throwing wrong results

I am doing my first project using Codeigniter 4. I am trying to make a summary page which consist of some sum from different columns and different tables. Here is the tables : table project id project_name 1 project 1 2 project 2 table…
1
vote
2 answers

codeigniter4 code to add employee redirects to itself on submit when regenerate is set to true in config.security

I have a codeigniter4 application. When i set public $regenerate = true; in Security.php the view with a form submit to add employee redirects to itself on submit. But when regenerate is false, code submits to the controller and data is processed as…
Tanzeem
  • 29
  • 8
1
vote
1 answer

Why is my Codeigniter 4 query build 'select' returning all fields?

I'm new to Codeigniter 4 but very familiar with Codeigniter 3. I'm trying to write a simple DB query to select certain fields from a DB row but the output always contains every field in the table. Here is my code (model):- public function test() { …
Andrew S
  • 13
  • 2
1
vote
1 answer

CodeIgniter 4: How to write conditional statements using the query builder chain. I.e., if...then

The following returns a mysqli_sql_exception error in the live server. I have traced the error from the following block of code: public function getByOPCR($opcr_id, $kpi_ids) { return $this->select('opcr_success_indicators.*, kpis.name,…
1
vote
2 answers

CI4 Attempt to read property "uri" on null

I am facing this error in my CI 4 Model (ErrorException. Attempt to read property "uri" on null) Here's my code below. namespace App\Models; use CodeIgniter\Model; class scoresheet_model extends Model { protected $table = 'players'; …
Novice
  • 41
  • 7
1
vote
1 answer

Call a function just before session gets auto destroyed after timeout in CodeIgniter 4

How to call a function just before session gets auto destroyed after timeout in CodeIgniter 4? I am capturing user logout (ip_address, id_user, id_app) in database, its working fine when user get logout manually (By calling logout method) but I am …
Diaulhak
  • 11
  • 2
1
vote
1 answer

Codeigniter 4 - Shield: What is the workflow for creating new users?

I have been playing around with CI4 and Shield for authentication and authorisation. There is very little information out there on the work flow for registering new users and how to notify the user that they have been registered into the app. Any…
nzdev01
  • 13
  • 2
1
vote
0 answers

Pass a variable from AJAX to PHP using XMLHttpRequest returns null

I've been struggling for a while: This is part of my AJAX code: