回复 Elex
$res->headers->set("location","www.baidu.com");
http://localhost/basic/web/www.baidu.com
是http://www.baidu.com 你上网的时候没加http是你的浏览器帮你加上了
                $res->headers->set("location","www.baidu.com");
http://localhost/basic/web/www.baidu.com
是http://www.baidu.com 你上网的时候没加http是你的浏览器帮你加上了
                    
                    2016-10-11
                
            有两个问题:
1、在响应头中add方法添加location并没有跳转;
2、使用redirect方法时,需要填写的连接以http开头即$this->redirect('http://www.baidu.com', 302);,否则的话会跳转到连接http://localhost/basic/web/www.baidu.com
                1、在响应头中add方法添加location并没有跳转;
2、使用redirect方法时,需要填写的连接以http开头即$this->redirect('http://www.baidu.com', 302);,否则的话会跳转到连接http://localhost/basic/web/www.baidu.com
                    
                    2016-09-29
                
            现在最新版本Yii2好像 已经不能从Yii::$app中获得cookies对象了,如果是新增cookies要用$cookies = Yii::$app->response->cookies; 得到
                
                    
                    2016-09-26
                
            $res->headers->set("location","www.baidu.com");    木有反应
                
                    
                    2016-09-24
                
            $customers=Customer::find()->with('orders')->asArray()->all();
加上width报错了不知道为什么呀
app\models\Customer has no relation named "orders".
                加上width报错了不知道为什么呀
app\models\Customer has no relation named "orders".
                    
                    2016-09-21