2009年10月19日星期一

[fw-mvc] zend_session and scoping a single session object

I have a standard MVC app and wanted to use session variables and haven't used the Zend_Session component so this will probably be a very naive question

Ideally, I'd like to be able to create a Zend_Session_Namespace in the index.php bootstrap file and be able to access in all the controllers, views, and view helpers.  It looks as if in the docs that in each location you need to instantiate the Zend_Session_Namespace object anew like so        

$sess=new Zend_Session_Namespace(); 

with the same name as the object in the index.php file. Is there any way to just make it globally availabe so that the above line doesn't need to be called?

thanks,

jonathan


没有评论: