回復 Elex
$res->headers->set("location","www.baidu.com");
http://localhost/basic/web/www.baidu.com
是http://www.baidu.com 你上網(wǎng)的時候沒加http是你的瀏覽器幫你加上了
$res->headers->set("location","www.baidu.com");
http://localhost/basic/web/www.baidu.com
是http://www.baidu.com 你上網(wǎng)的時候沒加http是你的瀏覽器幫你加上了
2016-10-11
有兩個問題:
1、在響應頭中add方法添加location并沒有跳轉(zhuǎn);
2、使用redirect方法時,需要填寫的連接以http開頭即$this->redirect('http://www.baidu.com', 302);,否則的話會跳轉(zhuǎn)到連接http://localhost/basic/web/www.baidu.com
1、在響應頭中add方法添加location并沒有跳轉(zhuǎn);
2、使用redirect方法時,需要填寫的連接以http開頭即$this->redirect('http://www.baidu.com', 302);,否則的話會跳轉(zhuǎn)到連接http://localhost/basic/web/www.baidu.com
2016-09-29
現(xiàn)在最新版本Yii2好像 已經(jīng)不能從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
我怎么覺得還是原生的sql關聯(lián)查詢比較好!這個轉(zhuǎn)來轉(zhuǎn)去的
2016-09-21