【问题标题】:Userfrosting remove /account/ in url用户冻结删除 /account/ 在 url
【发布时间】:2016-07-25 21:53:15
【问题描述】:

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

【问题讨论】:

  • 欢迎来到 Stack Overflow!我尽可能地编辑了你的问题。但是,添加代码和描述,以便更多具有该主题知识的人看到它。请在您遇到的特定错误消息中进行编辑,以防有必要识别特定问题。祝你好运!

标签: userfrosting


【解决方案1】:

每个路由的 URL 都在 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 的链接和引用。

【讨论】:

  • 非常感谢您的回复,这对我有帮助!
  • 没问题 - 请务必投票并接受我的回答!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-09-10
  • 1970-01-01
  • 1970-01-01
  • 2021-03-19
相关资源
最近更新 更多