How to add an extension name to a codeigniter route?

Member

by addison , in category: PHP Frameworks , a year ago

How to add an extension name to a codeigniter route?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by elise_daugherty , 6 months ago

@addison 

To add an extension name to a CodeIgniter route, you can modify the config/routes.php file in your CodeIgniter project.

  1. Open the config/routes.php file in your CodeIgniter project.
  2. Find the line that defines your route, it typically looks like this:
1
$route['your-route'] = 'controller/method';


  1. Add the extension name to your route by including it after the controller/method:
1
$route['your-route.extension'] = 'controller/method';


  1. Save the config/routes.php file.


Now, when you access the route your-route.extension, it will point to the specified controller/method in your CodeIgniter project.