From d76b8e95f60349fc1f75006071cb9e0ef6f566f3 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Mon, 1 Jan 2018 03:31:24 +0900 Subject: [PATCH] Update index.php --- index.php | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/index.php b/index.php index 76bad46..5a63b8c 100644 --- a/index.php +++ b/index.php @@ -9,6 +9,9 @@ define("_DEF_VSPF_", true); ini_set("max_execution_time", 0); +error_reporting(E_ALL); +ini_set("display_errors", 1); + // including vendor autoloader include_once('./vendor/autoload.php'); @@ -28,7 +31,7 @@ if(array_key_exists('route', $_REQUEST)) { } if(empty($route)) { - $route = 'welcome'; + $route = 'index'; } else { $route_names = explode('/', $route); if(count($route) > 1) { @@ -36,22 +39,10 @@ if(empty($route)) { } } -// view render -function renderView($name, $data=array()) { - if(count($data) > 0) { - extract($data); - } - - $viewfile = './view/' . $name . '.php'; - if(file_exists($viewfile)) { - include($viewfile); - } -} - // including route file $route_file_name = './route/' . $route . '.php'; if(file_exists($route_file_name)) { include($route_file_name); } else { - echo "404 Not Found"; + include('./route/errors/404.php'); }