mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-01 00:02:21 +09:00
Adjust some parts of Context class for better integration with Router
This commit is contained in:
parent
baddbd3cba
commit
a680f89326
3 changed files with 28 additions and 20 deletions
|
|
@ -44,9 +44,10 @@ class Router
|
|||
/**
|
||||
* Extract request arguments from the current URL.
|
||||
*
|
||||
* @param int $rewrite_level
|
||||
* @return array
|
||||
*/
|
||||
public static function getRequestArguments(): array
|
||||
public static function getRequestArguments(int $rewrite_level): array
|
||||
{
|
||||
// Get the local part of the current URL.
|
||||
$url = $_SERVER['REQUEST_URI'];
|
||||
|
|
@ -71,6 +72,17 @@ class Router
|
|||
return array();
|
||||
}
|
||||
|
||||
// Try to detect the prefix. This might be $mid.
|
||||
if ($rewrite_level > 0 && preg_match('#^([a-zA-Z0-9_-]+)#', $url, $matches))
|
||||
{
|
||||
$prefix = $matches[1];
|
||||
$module_info = \ModuleModel::getModuleInfoByMid($prefix);
|
||||
if ($module_info && $module_info->module)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
}
|
||||
|
||||
// Try XE-compatible rules.
|
||||
foreach (self::$_xe_compatible_rules as $regexp => $additional_args)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue