Created
March 1, 2010 14:37
-
-
Save joelg/318409 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// put this in application/config/routes.php | |
$route['default_controller'] = "welcome"; | |
$route['scaffolding_trigger'] = ""; | |
$controllers = glob(APPPATH."controllers/*.php"); | |
$route_string = ""; | |
foreach($controllers as $controller) { | |
$controller = str_replace("../system/application/controllers/", "", $controller); | |
$controller = str_replace(".php", "", $controller); | |
if($route_string == "") $route_string .= $controller; | |
else $route_string .= "|".$controller; | |
} | |
$route['^(?!'.$route_string.')\S*'] = "go"; // if not a controller, is sent to "go" controller | |
// more routes below |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment