Skip to main content
wpcrux.com

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 October 2025

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 Pro CodeIgniter: Learn how to create professional web-applications with PHP.

Pro CodeIgniter: Learn how to create professional web-applications with PHP.

BUY & SAVE
$9.50
Pro CodeIgniter: Learn how to create professional web-applications with PHP.
4 CodeIgniter: Web Framework (PHP Book 1)

CodeIgniter: Web Framework (PHP Book 1)

BUY & SAVE
$1.00
CodeIgniter: Web Framework (PHP Book 1)
5 Auto Mileage & Expense Notebook – Vehicle Mileage Log, Miles Log Book to Track Over 400 Rides or Sessions, Track Odometer for Business Driving or Rideshare Apps – 5 x 8 Inches, 60 Pages (Pack of 1)

Auto Mileage & Expense Notebook – Vehicle Mileage Log, Miles Log Book to Track Over 400 Rides or Sessions, Track Odometer for Business Driving or Rideshare Apps – 5 x 8 Inches, 60 Pages (Pack of 1)

  • EFFORTLESSLY TRACK MILEAGE & EXPENSES WITH OUR USER-FRIENDLY NOTEBOOK.
  • EXTRA 60 PAGES FOR A FULL YEAR; FITS EASILY IN ANY VEHICLE OR BAG!
  • DURABLE DESIGN ENSURES LONG-LASTING USE FOR YOUR DAILY TRACKING NEEDS.
BUY & SAVE
$8.99 $9.99
Save 10%
Auto Mileage & Expense Notebook – Vehicle Mileage Log, Miles Log Book to Track Over 400 Rides or Sessions, Track Odometer for Business Driving or Rideshare Apps – 5 x 8 Inches, 60 Pages (Pack of 1)
6 The Standards Real Book, C Version

The Standards Real Book, C Version

  • AFFORDABLE PRICING ON QUALITY USED BOOKS FOR SAVVY READERS.
  • ECO-FRIENDLY CHOICE: REDUCE WASTE BY BUYING PRE-LOVED BOOKS.
  • ACCESS A VARIETY OF TITLES; PERFECT FOR BUDGET-CONSCIOUS SHOPPERS.
BUY & SAVE
$45.42
The Standards Real Book, C Version
+
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: