作者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