1

我安装了yii2-user。在登录视图中,表单底部有几个链接。

<?= Html::a(Yii::t('user', 'Didn\'t receive confirmation message?'), ['/user/registration/resend']) ?>

<?= Html::a(Yii::t('user', 'Didn\'t receive confirmation message?'), ['/user/registration/resend']) ?>

当我单击这些链接中的任何一个时,会删除 URL 的注册部分。所以我留下了一个找不到的页面。它会把我送到

http://localhost/webs/parlay/web/index.php/user/resend

而不是把我送到

http://localhost/webs/parlay/web/index.php/user/registration/resend

这是我的 urlManager 配置。

'urlManager' => [
        'class' => 'yii\web\UrlManager',
        // Disable index.php
        'showScriptName' => true,
        // Disable r= routes
        'enablePrettyUrl' => true,
        'rules' => array(
                '<controller:\w+>/<id:\d+>' => '<controller>/view',
                '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
                '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
        ),
    ],
4

2 回答 2

0

检查这个线程,也许你有旧版本的yii2-user包。

您可以尝试删除//user/registration/resend编写自定义规则,例如

'user/resend' => 'user/registration/resend'

于 2015-09-12T22:06:40.420 回答
0

添加

<module:user>/<controller:\w+>/<action:\w+>' => '<module>/<controller>/<action>

到网址管理器。工作中

于 2015-09-13T01:53:49.970 回答