开发者

Zend Session Namespace

开发者 https://www.devze.com 2023-01-12 14:02 出处:网络
I\'m having a bit of a collision with the naming of the Zend_Session_Namespace parameter. What is the convention for the namespace other than \"default\"? Lets say i want to use it in the frontcontro

I'm having a bit of a collision with the naming of the Zend_Session_Namespace parameter.

What is the convention for the namespace other than "default"? Lets say i want to use it in the frontcontroller, should i name it Ze开发者_开发问答nd_Session_Namespace('Zend_Controller'); because the Zend_Auth convention is Zend_Session_Namespace('Zend_Auth');


You should namespace it in a way you can remember it and where it makes sense. If you are storing e.g. user options for a guest, maybe his name and email address for comments, you should probably name the namespace something like "guest-data". There is no real convention for that.


You can find the solution at Zend Framework reference guide http://framework.zend.com/manual/1.12/en/zend.session.basic_usage.html

It states that "Namespace names are restricted to character sequences represented as non-empty PHP strings that do not begin with an underscore ("_") character. Only core components included in Zend Framework should use namespace names starting with "Zend"."

Hope this helps you

0

精彩评论

暂无评论...
验证码 换一张
取 消