Browse Source

added script and style path constants. tweaked router usage in index.php.

Taylor Otwell 13 years ago
parent
commit
f16f90c89c
1 changed files with 8 additions and 2 deletions
  1. 8 2
      public/index.php

+ 8 - 2
public/index.php

@@ -23,6 +23,11 @@ define('SYS_PATH', realpath($system = '../system').'/');
 // --------------------------------------------------------------
 define('BASE_PATH', realpath(str_replace('system', '', $system)).'/');
 
+// --------------------------------------------------------------
+// The path to the public directory.
+// --------------------------------------------------------------
+define('PUBLIC_PATH', realpath(__DIR__).'/');
+
 // --------------------------------------------------------------
 // Define various other framework paths.
 // --------------------------------------------------------------
@@ -34,10 +39,11 @@ $constants = array(
 	'LIBRARY_PATH'  => APP_PATH.'libraries/',
 	'MODEL_PATH'    => APP_PATH.'models/',
 	'PACKAGE_PATH'  => APP_PATH.'packages/',
-	'PUBLIC_PATH'   => realpath(__DIR__).'/',
 	'ROUTE_PATH'    => APP_PATH.'routes/',
+	'SCRIPT_PATH'   => PUBLIC_PATH.'js/',
 	'SESSION_PATH'  => APP_PATH.'storage/sessions/',
 	'STORAGE_PATH'  => APP_PATH.'storage/',
+	'STYLE_PATH'    => PUBLIC_PATH.'css/',
 	'SYS_VIEW_PATH' => SYS_PATH.'views/',
 	'VIEW_PATH'     => APP_PATH.'views/',
 );
@@ -140,7 +146,7 @@ $response = System\Route\Filter::call('before', array(), true);
 // ----------------------------------------------------------
 if (is_null($response))
 {
-	$route = System\Router::route(System\Request::method(), System\Request::uri());
+	$route = System\Router::make(System\Request::method(), System\Request::uri())->route();
 
 	$response = (is_null($route)) ? System\Response::make(System\View::make('error/404'), 404) : $route->call();
 }