Promote your contents FREE, contents such as WebSites, YouTube channels, YouTube videos, Facebook, Instagram, LinkedIn, Twitter, Pinterest and many more.
Here it is shown how to create new controller in codeigniter framework and how to set view through controller and also how to set variable value in view from controller in codeigniter framework.
Or
This content was added on Promote Content at 03 Feb 2022 and got 760 visits untill now.
To create a controller in CodeIgniter, you will need to follow these steps: Open your CodeIgniter project in your preferred text editor or development environment. Navigate to the "Controllers" folder, which is located in the "application" directory of your project. Create a new PHP file in the "Controllers" folder and give it a name that reflects the purpose of the controller. For example, if the controller will handle user authentication, you might name it "Auth.php". At the top of the file, define the controller class by extending the CodeIgniter "CI_Controller" class. The class name should match the filename, with the first letter capitalized. For example: class Auth extends CI_Controller { } Inside the controller class, define a method (also called an "action") for each function you want the controller to perform. For example, you might define a "login" method to handle user login requests. To access the controller from a web browser, you will need to specify the controller and method in the URL. For example, to access the "login" method of the "Auth" controller, you would use the following URL: http://your-site.com/index.php/auth/login By following these steps, you should be able to create a controller in CodeIgniter and define methods to handle specific functions in your application.