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 , a year 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.

Related Threads:

How to get the current route name in Laravel?
How to get the current route name in vue.js?
How to define route name for nested resource in ember.js?
How to add .php extension in htaccess in laravel?
How to add ".php" extension using ".htaccess" file?
How to add middleware in Laravel route?