不能使用我的表格

时间:2010-06-03 13:15:32

标签: zend-framework

我的文件夹在/application/forms/Auth.php文件夹中 它看起来像

class Form_Auth extends Zend_Form
{
    public function __construct()
    {
        $this->setName();
        parent::__construct();

        $username = new Zend_Form_Element_Text('username');
        $password = new Zend_Form_Element_Password('password');
        $mail = new Zend_Form_Element_Text('mail');
        $submit = new Zend_Form_Element_Submit('submit');

        $this->addElements(array($username,$password,$mail,$submit));
    }
}

当我尝试创建对象

$this->view->form = new Form_Auth();

见exeption

  

申请错误

     

异常信息:

     

消息:提供的名称无效;必须   仅包含有效的变量字符   并且是非空的

     

堆栈追踪:

     

d:\ WWW \ zends \应用\形式\ Auth.php(8):   Zend_Form->的setName()   d:\ WWW \ zends \应用\控制器\ RegistrationController.php(49):   Form_Auth-> __构建体()   d:\ Web服务器\ ZendFramework \ ZendFramework \库\ Zend的\控制器\ action.php的(513):   RegistrationController->的indexAction()   d:\ Web服务器\ ZendFramework \ ZendFramework \库\ Zend的\控制器\分派器\ Standard.php(289):   Zend_Controller_Action->调度( '的indexAction')   d:\ Web服务器\ ZendFramework \ ZendFramework \库\ Zend的\控制器\ Front.php(954):   Zend_Controller_Dispatcher_Standard->调度(对象(的Zend_Controller_Request_Http),   对象(Zend_Controller_Response_Http))   d:\ Web服务器\ ZendFramework \ ZendFramework \库\ Zend的\应用程序\引导\ bootstrap.php中(97):   Zend_Controller_Front->调度()   d:\ Web服务器\ ZendFramework \ ZendFramework \库\ Zend的\ Application.php(366):   Zend_Application_Bootstrap_Bootstrap->运行()   D:\ WWW \ zends \ public \ index.php(26):Zend_Application-> run()   {main}请求参数:

     

array('controller'=>   'registration','action'=> '指数',   'module'=> '默认',)

版本zf是1.10.3

我做错了什么?

1 个答案:

答案 0 :(得分:0)

我们还管理了这个> setName('大多数有一些名字')

相关问题