首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >具有窗体的zend_session::start上的zend会话异常

具有窗体的zend_session::start上的zend会话异常
EN

Stack Overflow用户
提问于 2009-09-15 12:45:44
回答 2查看 1.7K关注 0票数 0

我在尝试使用Zend_Form_SubForm和会话时遇到了问题。我的控制器在essance中扮演向导,根据向导的阶段显示不同的子窗体。使用这个示例,我计划将表单存储在会话命名空间中。

我的控制器看起来像这样。

代码语言:javascript
复制
include 'mylib/Form/addTaskWizardForm.php';

class AddtaskController extends Zend_Controller_Action{

private $config = null;
private $log = null;
private $subFormSession = null;


/**
 * This function is called and initialises the global variables to this object
 * which is the configuration details and the logger to write to the log file.
 */
public function init(){

    $this->config = Zend_Registry::getInstance()->get('config');
    $this->log = Zend_Registry::getInstance()->get('log');

    //set layout
    $this->_helper->layout->setLayout('no-sidemenus');

    //we need to get the subforms and
    $wizardForms = new addTaskWizardForm();        

    $this->subFormSession = new Zend_Session_Namespace('addTaskWizardForms');

    if(!isset($this->subFormSession->subforms)){
        $this->subFormSession->subforms = $wizardForms;
    }

}

/**
 * The Landing page controller for the site.
 */
public function indexAction(){

    $form = $this->subFormSession->subforms->getSubForm('start');


    $this->view->form = $form;
}

但是,这会导致应用程序会话崩溃。

未指明的异常'Zend_Session_Exception‘与消息'Zend_Session::start()

知道为什么这和Zend会议有问题吗?

谢谢。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2009-09-17 14:50:11

确保会话开始前没有空格、新行或任何其他字符。特别是如果您有包含,并且您的<?php在文件的第2行中加上了空格或开始。

票数 0
EN

Stack Overflow用户

发布于 2009-09-15 16:54:53

非常奇怪,我看到这样的消息是在Zend/Session.php的第435至446行上发送的。

您是否试图通过单元测试运行该代码?在初始化会话之前,请检查没有发送任何标头。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/1426975

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档