gosimple 发表于 2009-5-21 11:06:29

整合smarty遇到的问题

我参照

http://codeigniter.org.cn/forums/thread-425-1-1.html
来整合smarty,结果出现如下错误


Severity: Notice
Message:Undefined variable: _SESSION
Filename: Smarty-2.6.24/Smarty.class.php
Line Number: 585

但是功能可以实现。请问怎么回事?谢谢

gosimple 发表于 2009-5-21 11:12:41

$this->_supers['session'] = $this->request_use_auto_globals ? $_SESSION : $GLOBALS['HTTP_SESSION_VARS'];

上面的是585行

gosimple 发表于 2009-5-21 11:25:58

http://www.phpinsider.com/smarty-forum/viewtopic.php?t=15444&view=previous&sid=84d4789ebf630561cc0d58a31a406877
在上面这个论坛里找到了解决办法,如下:

Had the same problem, but the SVN Code works here too. To fix until the next stable release change line 585 from this:
Code:
$this->_supers['session'] = $this->request_use_auto_globals ? $_SESSION : $GLOBALS['HTTP_SESSION_VARS'];


To this:
Code:
if (isset($_SESSION))
{
   $this->_supers['session'] = $this->request_use_auto_globals ? $_SESSION : $GLOBALS['HTTP_SESSION_VARS'];
}
else
{
   $this->_supers['session'] = array();
}
页: [1]
查看完整版本: 整合smarty遇到的问题