Promote your contents FREE, contents such as WebSites, YouTube channels, YouTube videos, Facebook, Instagram, LinkedIn, Twitter, Pinterest and many more.
Here it is explained how to do routing in codeigniter framework in easy way with examples.
Or
This content was added on Promote Content at 12 Feb 2022 and got 773 visits untill now.
In this video it is explained how to do routing in codeigniter. How to create custom URL through routes in codeigniter How to set default controller in codeigniter through routes How to hide class name and function from URL in codeigniter through routes. How to pass function name and parameters of function through URL in codeigniter through routes. In CodeIgniter, routing refers to the process of defining how URLs are mapped to specific controllers and methods. Routing allows you to customize the way that URLs are structured for your application, which can make it easier for users to understand and navigate your site. To set up routing in CodeIgniter, you will need to modify the "routes.php" file, which is located in the "config" directory of your application. This file contains an array of rules that define how URLs are mapped to controllers and methods. To create a new route in CodeIgniter, you will need to add a new element to the $route array. Each element in the array should contain an array of three elements: The first element is the URI pattern to match The second element is the controller and method to be called when the URI is accessed The third element is any additional parameters that should be passed to the controller method For example, to create a route that maps the URI "products/view" to the "products" controller and the "view" method, you would add the following element to the $route array: $route['products/view'] = 'products/view'; You can also specify additional parameters to be passed to the controller method by adding them to the URI pattern. For example, to pass a product ID to the "view" method, you could use the following URI pattern: $route['products/view/(:num)'] = 'products/view/$1'; This would pass the value of the first parameter in the URI (in this case, a product ID) to the "view" method as an argument. By defining routes in the "routes.php" file, you can control how URLs are structured in your CodeIgniter application and customize the way that users access different parts of your site.