Commit 07ca09e8 authored by Taylor Otwell's avatar Taylor Otwell

Add ACTIVE_MODULE constant.

parent 00af8c71
...@@ -131,15 +131,23 @@ $response = Routing\Filter::call('before', array(), true); ...@@ -131,15 +131,23 @@ $response = Routing\Filter::call('before', array(), true);
// -------------------------------------------------------------- // --------------------------------------------------------------
if (is_null($response)) if (is_null($response))
{ {
$path = (in_array($module = Request::segment(1), $modules)) ? MODULE_PATH.$module.'/' : APP_PATH; if (in_array($module = Request::segment(1), $modules))
if ($path !== APP_PATH)
{ {
define('ACTIVE_MODULE', $module);
$path = MODULE_PATH.$module.'/';
if (file_exists($filters = $path.'filters'.EXT)) if (file_exists($filters = $path.'filters'.EXT))
{ {
Routing\Filter::register(require $filters); Routing\Filter::register(require $filters);
} }
} }
else
{
define('ACTIVE_MODULE', 'application');
$path = APP_PATH;
}
$route = Routing\Router::make(Request::method(), Request::uri(), new Routing\Loader($path))->route(); $route = Routing\Router::make(Request::method(), Request::uri(), new Routing\Loader($path))->route();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment