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

Continue counting serial number affer page on pagination

I am displaying data results from database with php, ajax and jquery. I have used codeigniter 4 pager library for pagination. But when I click the next page of pagination the serial number reset and start again from 1-10, all I want is when i click…
ven
  • 185
  • 1
  • 18
2
votes
1 answer

Sending data to $this->include view in codeigniter 4

I have separated my template for CodeIgniter 4 in to different parts like header ,footer & sidebar. I can include them in main view like include('layouts/header') ?> but I can't send the data to this layouts, I try following syntax as…
2
votes
2 answers

How to open a view inside a view with CodeIgniter 4?

I am new with CodeIgniter 4. At CodeIgniter 3 we can use a view inside another view like this : load->view("containers/head"); ?> But same is not working with CodeIgniter 4 and I couldn't find it. Any…
dud3
  • 145
  • 1
  • 12
2
votes
1 answer

How to Call Subfolder Controller method in Routes in CodeIgniter 4

I have controllers in subfolders --Controllers ----Admin --------UserController --------AccountController ----User --------UserController --------AccountController I write routes for it $routes->group('user', function ($routes){ …
2
votes
1 answer

PHPMailer in Codegniter 4.0.0

I'm trying to call my library "Phpmailer" in the controller. I'm aware that there is a framework library to perform this task, however I still prefer PHPMailer. I followed a tutorial on integrating the library to the framework in version 3.0.0,…
Tavinho
  • 21
  • 1
  • 3
2
votes
2 answers

CodeIgniter 4 Only default route / is accessible, no other route is working if i define in my Routes.php. I am using ubuntu

My .htaccess file inside app/.htaccess and project directory is here. Both are same. i am using the same .htaccess file which is present inside public directory in both app and project directoyr Routes.php is here
Aqeel Ahmad
  • 21
  • 1
  • 4
2
votes
1 answer

Validation for file upload extension error using ext_in[] in codeigniter 4

I'm using flutter to upload files to a Php codeigniter 4 server. My problem is when I add validation for the uploaded file type. It always return file does not have a valid file extension. Upload.php $rules = [ 'file' =>…
unice
  • 2,655
  • 5
  • 43
  • 78
2
votes
0 answers

Codeigniter 4 Content Security Policy

I've pretty much got the gist of the content security policy from Codeigniter 4's user guide. From their example, I'll need to add the following 'runtime configuration' for my website's…
seixwebdev
  • 111
  • 2
  • 4
  • 14
2
votes
1 answer

How to use refresh token in codeigniter rest api?

I'm new in codeigniter 4 rest api and oath. I'm able to create login that return the token and the refresh token. My problem is when the token has expired. How can I get new token using the refresh token? Do I have to create a new function in the…
unice
  • 2,655
  • 5
  • 43
  • 78
2
votes
1 answer

Call to undefined method CodeIgniter\Database\MySQLi\Connection::like()

I have i like query in my model but it doesn't work Model:
Farid
  • 158
  • 1
  • 2
  • 13
2
votes
1 answer

Codeigniter 4 assets PATH configuration for Modules

I m creating different directories for Role-based access in Codeigniter 4. I have created the Modules directory inside app/ i.e (app/modules/admin). I have assets for the admin. I want to load it in the header file of view. I have tried it with the…
Mansoor Ahmad
  • 38
  • 1
  • 7
2
votes
2 answers

CodeIgniter 4 Populating menu from database on View Layout

I'm new in CodeIgniter in general. I have a view layout, on which I have navigation menu bar in it. I want to populate the dropdown menu with categories I've saved in database. Here's snippet of my layout (View\layouts\frontend.php):
tuxguitar
  • 21
  • 3
2
votes
1 answer

how to set different sessions for user and admin | CodeIgniter

hello i am working on a project where user and admin have different logins I want to set different sessions for user and admin here is I how set admin session $this->session->set('adminData', [ 'id' => $teacher['id'], …
WebRTClerni
  • 149
  • 1
  • 8
2
votes
2 answers

Codeigniter 4 error 404 after form post submit there is problem with route

I using Codeigniter 4 I already add in Routes.php $routes->get('/register', 'Auth::register'); and this is Auth.php public function register() { $data['page_title'] = "Register"; if ($this->request->getMethod() === 'post')…
yozawiratama
  • 4,209
  • 12
  • 58
  • 106
2
votes
1 answer

Is it possible to use dynamic controller name in routing in CodeIgniter 4?

I want to use route localization like said here https://codeigniter.com/user_guide/outgoing/localization.html#in-routes So I need to add route rule like: $routes->get('{locale}/books', 'App\Books::index'); But I want to make this rule for all…
T.O.M.
  • 83
  • 9