作者adxis (acer)
看板PHP
標題Re: [請益] 關於MVC 中使用Zend_Registry
時間Thu Nov 22 23:23:43 2007
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.225.52.161
1F:→ tsangbor:離開設定的action? 你怎麼去set的? 11/22 22:51
class fooController extends Zend_Controller_Action
{
function barAction(){
....
Zend_Registry::set('index',$key);
}
function chaAction(){
Zend_Registry::isRegistered('index');
//false
}
}
然而在index.php中set給registry的東西都還在
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.225.34.117
2F:→ tsangbor:Zend_Registry::isRegistered($index); 不是'index' 11/22 23:41
3F:→ tsangbor:回應錯誤!手冊的範例有錯~我測試也不work,改回'index' 11/22 23:45
4F:→ tsangbor:但是我Zend_Registry在其它類是正常的. 11/22 23:46