yii2两个单词r命名controle找不到404错误 [ 求助交流 ]
namespace app\modules\controllers;
use Yii;
``
这里输入代码
use yii\helpers\Url;
use yii\web\Controller;
use app\modules\models;
use app\modules\models\OauthOpenid;
class SalesStatisticsControllerController extends Controller
{
public $title ;
public function beforeAction($action)
{
return parent::beforeAction($action); // TODO: Change the autogenerated stub
$session = Yii::$app->session;
$wx = new Wx();
if($wx ->is_weixin()) {
if (!empty($session['TokeyOpid']['openid'])) {
$model = new OauthOpenid();
$oauth = $model->findOne(['openid' => $session['TokeyOpid']['openid']]);
if (empty($oauth)) {
return $this->redirect(Url::to(['login']));
}
}
}else {
$model = new UdbUser();
$user = $model->findOne(['user_name' => $session['user']['user_name']])->toArray();
if(empty($user)) {
return $this->redirect(Url::to(['login']));
}
}
return true;
}
public function actionIndex(){
$this->title = '';
// $this->render('');
}
}
http://127.0.0.1/index.php?r=formes/trafficstatistics/index 为什么找出现404呀
这样http://127.0.0.1/index.php?r=formes/trafficStatistics/index
还有http://127.0.0.1/index.php?r=formes/TrafficStatistics/index
都不行`
共 4 条回复
-
我把controller改成 class TrafficStatisticsController extends Controller
http://127.0.0.1/index.php?r=formes/trafficstatistics/index 为什么找出现404呀
这样http://127.0.0.1/index.php?r=formes/trafficStatistics/index
还有http://127.0.0.1/index.php?r=formes/TrafficStatistics/index
http://127.0.0.1/index.php?r=formes/traffic-statistics/index
都不行`
w2096
注册时间:2016-05-13
最后登录:2016-06-08
在线时长:3小时26分
最后登录:2016-06-08
在线时长:3小时26分
- 粉丝0
- 金钱50
- 威望0
- 积分80