コード例 #1
0
ファイル: index.php プロジェクト: vetermanve/vk_workmart
function web_controller_index_index()
{
    lets_use('user_self');
    if (user_self_id()) {
        web_router_call('order', 'list', '');
        return;
    }
    web_router_render_page('index', 'index');
}
コード例 #2
0
ファイル: router.php プロジェクト: vetermanve/vk_workmart
function web_router_route($uri, $get, $post)
{
    global $_web_router_request_data;
    $_web_router_request_data = (array) $get + (array) $post;
    $uri = strpos($uri, '?') ? strstr($uri, '?', true) : $uri;
    $pathInfo = explode('/', trim($uri, '/'));
    $controllerPart = !empty($pathInfo[0]) ? $pathInfo[0] : 'index';
    $actionPart = !empty($pathInfo[1]) ? $pathInfo[1] : 'index';
    $controller = str_replace(['_', '/', ' '], '', $controllerPart);
    $action = str_replace(['_', '/', ' '], '', $actionPart);
    web_router_call($controller, $action, $uri);
}