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

What is the most effective way to select all data from many-to-many table?

I designed many to many table below: activity ---------- id name activity_student ---------- id activity_id student_id student ---------- id name Each students can participate lots of activities, and each activities can have many…
tonynamy
  • 29
  • 1
  • 5
-1
votes
1 answer

How can i access my controller located in "folder_name/controller_name" in codeigniter 4?

My Master controller located in "admin" folder. View image here namespace App\Controllers\admin; use CodeIgniter\Controller; class Master extends Controller { function __construct(){ helper('url'); } public function…
sebake
  • 9
  • 4
-2
votes
2 answers

Redirect does not load the page

Trying to redirect in Ci4 but getting an error. Found similar post w/ diff error message. Ci4 Php 8.1.20 After deleting a post, trying to redirect to /blog page Have the route in the routes.php Post successfully deletes from DB but page redirects…
chappie
  • 119
  • 4
  • 12
-2
votes
1 answer

codeigniter 4 Call to a member function getResult() on bool error on live server but not on local host

After working on a project on my local host, the the system works perfectly but after hosting on a live server, i noticed most of my function are giving the "Call to a member function getResult() on bool" error. $data['user_payouts'] =…
-2
votes
2 answers

How to upload default picture if user delete the picture?

So, i want to make if user click the delete button the picture profile will be user.jpg (this is default picture). enter image description here here is my controller : public function update() { $fileimg = $this->request->getFile('img'); …
ziers
  • 1
-2
votes
1 answer

submit button can't find save method

I have a form that use submit button. My submit button always refer to mypages.com/pages/save, but my save function can appear with mypages.com/save. are there any ways to make my submit button refer to /save not /pages/save? I put this in my route,…
-2
votes
3 answers

How to delete cookies in codeigniter 4?

I apply this method in ci4 to delete_cookie but it can't work. if(delete_cookie(get_cookie("urs_name"))){ echo "coookie deleted"; }else{ echo "Unable to delete cookies"; } Anyone can help one.
-2
votes
1 answer

How to convert HMAC_SHA256_MAC in PHP

index.php
Aaditi
  • 7
  • 4
-2
votes
1 answer

Delete multiple records in codeigniter without using form

I am trying to delete multiple records in codeigniter 4, I am passing this in codeigniter but that can not work Pass this function in Model public function delete_user($id) { $db = Database::connect(); $db->where_in('id', $id); …
-2
votes
1 answer

how can I autoload session library once in CI4 and access every where like CI3

I am using Codeigniter 4.1 for my project. I had worked on CI3 before. I want to load the session library once in the project and access it everywhere like we use in CI3 autoload.php. I have added $this->session = \Config\Services::session(); code…
Pankss
  • 29
  • 5
-2
votes
1 answer

Invalid rule in CodeIgniter 4

I'm trying to create an update page for users. The firstname and lastname are getting updated successfully, but when I try to update the password it gaves me an error which says that the rule is not a valid rule. I can't understand what is the…
Anna
  • 1
  • 2
-2
votes
1 answer

CodeIgniter 4 findAll empty

Please can someone help with My Model. I want to get users from table users in database (SQL Server) with model builder. Example: $cred= new CredModel(); $cred->select('*'); $list=$cred->findAll(); Model returns array(0). I use SQL Server with…
And C
  • 1
  • 1
-2
votes
1 answer

Problem with "A PHP Error was encountered : Undefined Index"

i have a problem with my code and i don't know how to fix these, i don't know why it said undefined could you please help me to solve this problems? Message: Undefined index: nik Filename: controllers/User.php Line Number: 24 these are the code…
EVE
  • 3
  • 2
-3
votes
1 answer

Use Empty Function with Foreach loop

I want to output a message when there are no items in the database. The code does not print the statement when the database doesn't have data. This is my code,
-3
votes
1 answer

Codeigniter 4 API with Angular : 'http://localhost:4200' has been blocked by CORS policy

Honestly, I've been struggling and trying every solution to overcome this issue caused by the Codeigniter API controller but unfortunately still not solved yet. So using angular and whenever I try to call this API:…
Amine Faiz
  • 93
  • 1
  • 2
1 2 3
82
83