Skip to main content
SidsProjectImpact

Back to all posts

How to Create A New Controller In CodeIgniter?

Published on
8 min read
How to Create A New Controller In CodeIgniter? image

Best CodeIgniter Development Books to Buy in January 2026

1 CodeIgniter 2 Cookbook

CodeIgniter 2 Cookbook

BUY & SAVE
$54.99
CodeIgniter 2 Cookbook
2 CodeIgniter: Learn By Coding

CodeIgniter: Learn By Coding

BUY & SAVE
$2.99
CodeIgniter: Learn By Coding
3 PHP CodeIgniter

PHP CodeIgniter

BUY & SAVE
$55.22
PHP CodeIgniter
4 CodeIgniter: Produtividade na criação de aplicações web em PHP (Portuguese Edition)

CodeIgniter: Produtividade na criação de aplicações web em PHP (Portuguese Edition)

BUY & SAVE
$9.99
CodeIgniter: Produtividade na criação de aplicações web em PHP (Portuguese Edition)
5 CodeIgniter: Web Framework (PHP Book 1)

CodeIgniter: Web Framework (PHP Book 1)

BUY & SAVE
$1.00
CodeIgniter: Web Framework (PHP Book 1)
6 Desvendando o CodeIgniter 4 (Portuguese Edition)

Desvendando o CodeIgniter 4 (Portuguese Edition)

BUY & SAVE
$9.99
Desvendando o CodeIgniter 4 (Portuguese Edition)
+
ONE MORE?

To create a new controller in CodeIgniter, follow these steps:

  1. Open your CodeIgniter project's application folder.
  2. Navigate to the controllers folder within the application folder.
  3. Create a new PHP file with a filename that corresponds to the name of your desired controller. For example, if you want to create a controller named "Home", create a file named "Home.php".
  4. Open the newly created PHP file in a text editor or IDE of your choice.
  5. Add the following code snippet to the PHP file: