我就想用一下redirect()->remember();和redirect()->restore();这个新特性。
MD一直没反应!
浪费我一上午时间,到现在还没找到原因。
不是想拥抱新版本,使用新特性,早就老老实实去用$this->redirect()跳转了。
**************************
话说你们新版本控制器可以不继承Controller有什么用?不继承Controller什么功能都不能用。这种看似简单了的设计,意义在哪里?
好吧,我继承了Controller,然后呢?redirect()还是一点反应都没有。
然后我又怀疑是不是写在父类的_initialize()里没有用?于是我不用_initialize了,我用protected $beforeActionList声明前置操作,还是没用!
好吧,也许是前置操作的方法也不能写在父类里?那我把它拿到子类来!(可是这样还有什么意义?逻辑还要不要分离了?)依旧没有用!
那我父类都不用了,前置操作也不用了,就想成功试一下redirect(),总能行了吧!
public function test(){
echo "this is test";
dump(redirect('index/index/test2'));
}
public function test2(){
echo "this is test2";
}
public function test3(){
echo "this is test3";
}然后呢?跳啊!你TM倒是给我跳啊!this is test
ob
["options":protected] => array(0) {
}
["params":protected] => array(0) {
}
["data":protected] => string(17) "index/index/test2"
["contentType":protected] => string(9) "text/html"
["charset":protected] => string(5) "utf-8"
["code":protected] => int(302)
["header":protected] => array(2) {
["Content-Type"] => string(24) "text/html; charset=utf-8"
["Cache-control"] => string(24) "no-cache,must-revalidate"
}
["content":protected] => NULL
}
是我脑子蠢,看不懂你们的文档?方法用错了?
*****************************
声明,所有的尝试中,无论父类子类,都保证有继承了Controller
最佳答案