Add ACTIVE_MODULE constant.
This commit is contained in:
parent
00af8c715f
commit
07ca09e824
|
@ -131,15 +131,23 @@
|
||||||
// --------------------------------------------------------------
|
// --------------------------------------------------------------
|
||||||
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();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue