【发布时间】:2010-10-28 03:45:41
【问题描述】:
你能告诉我如何在 zf app 的引导文件中包含 Zend_Session::start() 吗?
【问题讨论】:
标签: zend-framework
你能告诉我如何在 zf app 的引导文件中包含 Zend_Session::start() 吗?
【问题讨论】:
标签: zend-framework
您需要做的就是在配置文件的“资源”部分中提供一个“会话”部分。
我建议至少设置一个会话名称,例如
resources.session.name = "MyAppName"
或者如果使用 Zend_Config_Xml
<resources>
<session>
<name>MyAppName</name>
</session>
</resources>
如果你想在你的 Bootstrap 类中做一些会话的东西,只要确保你首先引导会话资源来选择你的配置选项,例如
protected function _initSessionNamespaces()
{
$this->bootstrap('session');
// now create your namespace(s) and whatnot
}
【讨论】:
_initSession,但类似的东西会覆盖默认的“会话”应用程序资源引导(我认为)。