mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
Reorganize data exchange format between Context and Router
This commit is contained in:
parent
c8a6b8de79
commit
85fcc79457
4 changed files with 81 additions and 26 deletions
|
|
@ -127,6 +127,10 @@ class Context
|
|||
*/
|
||||
private static $_init_called = false;
|
||||
|
||||
/**
|
||||
* Current route information
|
||||
*/
|
||||
private static $_route_info = null;
|
||||
/**
|
||||
* object oFrontEndFileHandler()
|
||||
* @var object
|
||||
|
|
@ -237,9 +241,9 @@ class Context
|
|||
{
|
||||
$method = $_SERVER['REQUEST_METHOD'] ?: 'GET';
|
||||
$url = $_SERVER['REQUEST_URI'];
|
||||
$route = Rhymix\Framework\Router::getRequestArguments($method, $url, Rhymix\Framework\Router::getRewriteLevel());
|
||||
self::setRequestArguments($route->args);
|
||||
self::set('route_info', $route);
|
||||
$route_info = Rhymix\Framework\Router::parseURL($method, $url, Rhymix\Framework\Router::getRewriteLevel());
|
||||
self::setRequestArguments($route_info->args);
|
||||
self::$_route_info = $route_info;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -614,6 +618,16 @@ class Context
|
|||
return self::$_instance->db_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current route information
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
public static function getRouteInfo()
|
||||
{
|
||||
return self::$_route_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return ssl status
|
||||
*
|
||||
|
|
@ -1743,7 +1757,7 @@ class Context
|
|||
$query = '';
|
||||
if(count($get_vars) > 0)
|
||||
{
|
||||
$query = Rhymix\Framework\Router::getURLFromArguments($get_vars, $rewrite_level);
|
||||
$query = Rhymix\Framework\Router::getURL($get_vars, $rewrite_level);
|
||||
}
|
||||
|
||||
// If using SSL always
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue