Codeigniter, Web Development
Hello Friends,
Welcome to Part 05 of the Codeigniter 4 Tutorial Series in Urdu/Hindi. Today in this Video Tutorial, We are going to learn about Controllers and Routing in Codeigniter 4.
Controllers handle incoming requests.
A Controller is simply a class file that is named in a way that it can be associated with a URI.
Consider this URI:
example.com/index.php/helloworld/
Routing rules are defined in the app/config/Routes.php file. In it you’ll see that it creates an instance of the RouteCollection class that permits you to specify your own routing criteria. Routes can be specified using placeholders or Regular Expressions.
In the above example, CodeIgniter would attempt to find a controller named Helloworld.php and load it.