Skip to main content
wpcrux.com

Back to all posts

How to Create A New Controller In CodeIgniter?

Published on
8 min read

Table of Contents

Show more
How to Create A New Controller In CodeIgniter? image

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: