CodeIgniter Forums

Full Version: Inserting custom route files to routes.php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Dear All

In my routes.php, I have included more than 10 external files as follows

require_once APPPATH . 'cache/routes1.php';
require_once APPPATH . 'cache/routes2.php';
require_once APPPATH . 'cache/routes3.php';
require_once APPPATH . 'cache/routes4.php';
require_once APPPATH . 'cache/routes5.php';

Is there a way to load some of these files on certain controllers.

For example, 

--I would like to load routes1.php only when accessing the controler "XYZ"
--I would like to load routes2.php only when accessing the controler "ABC"


Is it possible to achieve this?

Thank you