From c8f38cf49976044c59d38be40760bd8803eda4ea Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Fri, 22 Feb 2019 23:34:56 +0900 Subject: [PATCH] Update uri.php --- system/uri.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/system/uri.php b/system/uri.php index cffc447..bbb1194 100644 --- a/system/uri.php +++ b/system/uri.php @@ -31,6 +31,23 @@ if(!function_exists("get_uri")) { } } +if(!function_exists("read_route")) { + function read_route($route=false) { + $config = get_config(); + $requests = get_requests(); + + // get requested route + $route = get_requested_value("route"); + + // if empty route + if(empty($route)) { + $route = get_value_in_array("default_route", $config, "welcome"); + } + + return $route; + } +} + if(!function_exists("read_requests")) { function read_requests($options=array()) { // process http encryption