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

How to get specific columns in CodeIgniter 4?

I wanna select specific columns from table. Not all columns. $this->userModel->where($where)->first(); I'm using this but it returns all data.
Hamid Ejaz
  • 88
  • 1
  • 1
  • 7
2
votes
2 answers

Multiple like conditions in Codeigniter 4

Please help me to use multiple conditions in Codeigniter 4? I have used the following codes but it doesn't work, threw an error, with one like its working fine. $users = $model->like('title', $this->request->getVar('search'))->like('name',…
2
votes
3 answers

CodeIgniter 4: Autoload Library

I'm using the latest 'master' branch of CodeIgniter 4 I have a Library that I'm trying to load automatically. Effectively, I want to have have 'one' index.php (that has meta, the basic html structure, etc) through which I can load views via my…
Ryan Dorn
  • 679
  • 2
  • 8
  • 20
2
votes
2 answers

Class 'App\Model\Users' not found in Codeigniter4

I am working with the latest version of codeigniter framework. Something is wrong with my code, it gives me an error like: Class 'App\Model\Users' not found Controller Filename: Auth.php
user11988937
2
votes
5 answers

CodeIgniter 4, helper function not working

I've tried to autoload the helper function. I've added the helper file in autoload.php and called the function in the view file, but it's not working. app/Config/autoload.php $psr4 = ['Config' => APPPATH . 'Config', APP_NAMESPACE =>…
Senthil
  • 757
  • 2
  • 7
  • 25
2
votes
2 answers

How to access Stripe in CodeIgniter 4

I'm trying to load the Stripe PHP API (installed via Composer) into my CodeIgniter 4 app. This is what my files look like: Composer.json { "description": "The CodeIgniter framework", "name": "codeigniter/framework", "type": "project", …
Pecans
  • 307
  • 5
  • 16
2
votes
3 answers

Codeigniter 4 , running error

I am testing CodeIgniter 4, but I am getting this error: Fatal error: Default value for parameters with a class type hint can only be NULL in C:\xampp\htdocs\CodeIgniter4-develop\system\Config\DotEnv.php on line 121 What am I missing?
Waleed Ahmed Haris
  • 1,229
  • 11
  • 17
1
vote
1 answer

I have an issue with a loop in my php code

public function addToTransfer($data) { $countProductsAdded = $this->where('product_id', $data['product_id']) ->where('product_transfer_id', $data['product_transfer_id']) ->where('transfer_id',…
1
vote
1 answer

How to solve warning 'Use of $this in global code might be unatendedPHP(PHP0437)' when layouting view in Codeigniter 4?

I'm still beginner in codeigniter. I try to layouting template (dinamic page) with view layout in codeigniter 4. But all of code $this have warning that says Use of $this in global code might be unatendedPHP(PHP0437) The web still running cause…
uul
  • 9
  • 5
1
vote
1 answer

Remove or hide specific string in a url using .htaccess

I have this url https://test.app/myapp/login. All I want is to remove the 'myapp' string using .htaccess. This is what I tried so far. RewriteEngine on RewriteCond $1 !^(index\.php|resources|robots\.txt) RewriteCond %{REQUEST_FILENAME}…
unice
  • 2,655
  • 5
  • 43
  • 78
1
vote
1 answer

I can not update database in CodeIgniter 4 , model's update() function doesn't work

how are you? I have a problem with Mysql DB update using CI 4.x model update function. $outletUpdateModel->where('id',$data['id'])->set($temp)->update() There is no error with code. but I can not see any update on db. Thank you for your time. I…
1
vote
0 answers

Comparing two 2d arrays in php codeigniter4 and having issues in calculation of column totals and identifying duplicate values

I am working on project where I am uploading two excel files and able to get the files data in 2d associative arrays. I want to calculate the total of 2 rows if it exists only on array1 and not exists on array2. I want to highlight the duplicates…
1
vote
1 answer

Convert PHP Spreadsheet generated Multidimensional Array to Associative Array using first row as columns names(key)

I am working with php spreadsheet library and was able to get the multi dimensional array of sheet data. but now I want to convert this array to an associative array by using first row of sheet as keys. $arr_upsfile = explode('.',…
1
vote
0 answers

Codeigniter 4 gives an error, "Array to string conversion"

I'm using this for the first time. I want create a new form to edit user detail. I get an error of Array to string conversion, If I remove the , the view looks good this is my controller code public function…
Yapeng
  • 29
  • 2
1
vote
0 answers

Codeigniter 4 sum many columns in multiple join table giving 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…