Add ACTIVE_MODULE constant.

This commit is contained in:
Taylor Otwell 2011-08-05 09:38:15 -05:00
parent 00af8c715f
commit 07ca09e824
1 changed files with 11 additions and 3 deletions

View File

@ -131,15 +131,23 @@
// --------------------------------------------------------------
if (is_null($response))
{
$path = (in_array($module = Request::segment(1), $modules)) ? MODULE_PATH.$module.'/' : APP_PATH;
if ($path !== APP_PATH)
if (in_array($module = Request::segment(1), $modules))
{
define('ACTIVE_MODULE', $module);
$path = MODULE_PATH.$module.'/';
if (file_exists($filters = $path.'filters'.EXT))
{
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();