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

how to make image link open in a new tab - CodeIgniter 4

I have tried to open the image in a new tab, but instead of opening it keeps downloading image src URL comes from DB as it is stored on an s3 bucket src: "https://****.s3.us-east-2.amazonaws.com/cat_1665033741880.png" Code:
Emma
  • 79
  • 3
2
votes
1 answer

Oracle database connection via Codeingniter 4

Hi I have a Oracle database installed locally on my laptop. I'd like to connect to it via Codeigniter 4. Since version 4.2.0 it is able to do so. https://codeigniter4.github.io/CodeIgniter4/changelogs/v4.2.0.html All my database credentials are in…
Dusan
  • 3,284
  • 6
  • 25
  • 46
2
votes
1 answer

Call to undefined function form_open() in CI 4

I am using CodeIgniter 4 and loading form helper in the following way, but it still says, Call to undefined function form_open() In BaseController.php i am autoloading form helper. protected $helpers = ["form"]; Route: $routes->get('admin/login',…
Hamza Zafeer
  • 2,360
  • 13
  • 30
  • 42
2
votes
0 answers

We create a dynamic sitemap in CodeIgniter but in view it will treat my XML file as HTML

How do I set the route for our sitemap? Currently we set header in our controller, but in the view, it will show as plain text. controller code public function sitemap(){ $data = []; $model = new BlogModel(); $data[‘blogs’] =…
2
votes
1 answer

Call to undefined function App\Helpers\htmlpurifier()

I am trying to integrate HTMLpurifier into codeigniter, for text editor. I created a helper in App/Helpers named it to htmlpurifier_helper.php and added Purifier function in it like so : defined('BASEPATH') or exit('No direct script access…
DLK
  • 161
  • 8
2
votes
2 answers

How do you resolve the error "unexpected '_592_000'" while setting up CodeIgniter 4.2?

I got the below error when trying to set up CodeIgniter 4.2 PHP Parse error: syntax error, unexpected '_592_000' (T_STRING), expecting ',' or ')' in C:\xampp\htdocs\Test1\app\Config\Constants.php on line 41 I didn't change anything on…
Arun A N
  • 21
  • 3
2
votes
4 answers

Codeigniter 4 Email sending with HTML as message

can you help me figure out a way to use the email class of CI4 to send an email with an HTML as the message? in Codeigniter 3 it is simple and goes like this: $email->message($this->load->view('html_page_to_send_from_view_folder',$data,true)); but…
2
votes
1 answer

CodeIgniter 4 Session is destroyed after refreshing the website

My session is always destroyed after refreshing the page. This is my setting. app.sessionDriver = 'CodeIgniter\Session\Handlers\DatabaseHandler' app.sessionCookieName = 'sippeg_session' app.sessionExpiration = 0 app.sessionSavePath =…
2
votes
2 answers

How do you convert a CodeIgniter 2 project to CodeIgniter 4?

I have one old CodeIgniter 2 project. How do I update/upgrade it to CodeIgniter version 4 without any code or function change? Is it possible?
2
votes
1 answer

codeigniter 4 rest api error 501 show action not implemented

I'm trying to create a simple REST server using CI 4 based on this article. this is my code: app/Controllers/Barang.php
dapidmini
  • 1,490
  • 2
  • 23
  • 46
2
votes
2 answers

Codeigniter 4 - route now working / 404 / Controller or its method is not found

Here are a couple of my routes; This one works: $routes->get('/admin/users', 'Admin/User/User_Controller::user_index'); This one doesn't…
spreaderman
  • 918
  • 2
  • 10
  • 39
2
votes
1 answer

How to make query in model with 2 parameters

I need make a query with 2 parameters in model on codeigniter 4. Is this possible? This is the model: public function obtenerProyectoId($id_user,$id_project) { $proyectos = $this->db->query(" SELECT * FROM proyectos INNER JOIN empresa ON…
2
votes
1 answer

codeigniter 4 url ​goes into loop

I think the problem may be from LanguageControl. Refreshing the page by repeating the url all the time. I am using multi-language support in the admin panel. Below are all the code blocks that I think might be the problem. route $routes->get('/',…
kartenel
  • 25
  • 4
2
votes
3 answers

SYSTEMPATH/CodeIgniter.php at line 219

CodeIgniter show this problem: SYSTEMPATH/CodeIgniter.php at line 219. I already added extension=intl to php.ini file. But the error still. Error : The framework needs the following extension(s) installed and loaded: intl. 1.…
Erna Piantari
  • 547
  • 2
  • 11
  • 26
2
votes
5 answers

Undefined constant "CodeIgniter\Database\MySQLi\MYSQLI_STORE_RESULT" in CodeIgniter 4 project

I have CodeIgniter project (4.1.5) installed with Composer. I am running it on PHP 8.0.12 When I try to communicate with the database, I get Internal server error 500 and log message is the following: CRITICAL - 2021-11-13 01:39:18 --> Undefined…
D.B.
  • 89
  • 1
  • 9