Userfrosting删除/ account / in url

时间:2016-07-25 21:53:16

标签: userfrosting

我正在使用UserFrosting构建我的网站,并想知道我是否能够从登录和注册页面的网址中删除/ account /?

1 个答案:

答案 0 :(得分:1)

每条路线的网址都在public/index.php中定义。所以,你想把它们分开:

$app->get('/login/?', function () use ($app) {    
    // Forward to installation if not complete
    if (!isset($app->site->install_status) || $app->site->install_status == "pending"){
        $app->redirect($app->urlFor('uri_install'));
    }

    $controller = new UF\AccountController($app);
    return $controller->pageLogin();
});


$app->get('/register/?', function () use ($app) {    
    // Forward to installation if not complete
    if (!isset($app->site->install_status) || $app->site->install_status == "pending"){
        $app->redirect($app->urlFor('uri_install'));
    }

    $controller = new UF\AccountController($app);
    return $controller->pageRegister();
});

您还需要在客户端代码(Javascript)中对/account/register/account/login的链接和引用进行查找和替换。