简体   繁体   English

php - “致命错误:未找到类”zend框架1

[英]php - “Fatal error: Class not found” zend framework 1

I have created a form named signin in a module named sign in zend framework version 1 and it says "Class 'Sign_Form_Signin' not found " 我在一个名为sign in zend framework version 1的模块中创建了一个名为signin的表单,它说“找不到类”Sign_Form_Signin'

Here is form code: 这是表单代码:

    <?php

class Sign_Form_Signin extends Zend_Form
{

    public function init()
    {
        $this->setAction("/sign/in");
        $this->setMethod("post");

        $username=new Zend_Form_Element_Text("password");
        $username->addValidator(new Zend_Validate_Alnum())
                ->setRequired(TRUE)
                ->setLabel("نام کاربری: ")
                ->setAttrib("size", "25");
        $password=new Zend_Form_Element_Password("password");
        $password->addValidator(new Zend_Validate_Alnum)
                ->setRequired(TRUE);
        $submit=new Zend_Form_Element_Submit("submit");
        $submit->setLabel("ورود");
        $this->addElement($username);
        $this->addElement($password);
    }


}

Here is Application.ini 这是Application.ini

[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0

resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"

resources.view[] =


resources.db.adapter = "PDO_MYSQL"
resources.db.params.dbname = "test"
resources.db.params.host = "localhost"
resources.db.params.port="8889"
resources.db.params.username = "root"
resources.db.params.password = "root"
resources.db.params.charset  = "UTF8"

resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
[staging : production]

[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1

[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1

and here is the controller code: 这是控制器代码:

<?php

class Sign_IndexController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
        // action body
    }

    public function inAction()
    {
        $form=new Sign_Form_Signin();
        $this->view->form= $form;
    }

    public function outAction()
    {
        // action body
    }


}

Do you have any ideas that what the problem is? 你有什么想法,问题是什么?

If your name form is new Sign_Form_Signin(); 如果你的名字形式是新的Sign_Form_Signin();

You must to locate the class form in Sign/Form/Signin.php 您必须在Sign / Form / Signin.php中找到类表单

Each _ in of the classname means a directory for the real path. classname中的每个_ in表示真实路径的目录。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 致命错误:在Zend Framework 2中找不到类 - Fatal error : class not found in Zend framework 2 PHP Zend 2:致命错误-找不到类 - PHP Zend 2: Fatal Error - Class not found PHP Zend库导致致命错误:找不到类“ Zend \\ [whatever]” - PHP Zend library results in Fatal Error: class 'Zend\[whatever]' not found zend框架中的phpexcel 2致命错误:找不到类&#39;PHPExcel_IOFactory&#39; - phpexcel in zend framework 2 Fatal error: Class 'PHPExcel_IOFactory' not found 致命错误:在Zend Framework + Wamp中找不到类“ Memcache” - Fatal error: Class 'Memcache' not found in Zend Framework + Wamp 致命错误:在服务器中部署但不在本地部署时,在Zend Framework 2中找不到类 - Fatal error: Class not found in Zend Framework 2 when deployed in server but not locally PHP致命错误:找不到类&#39;Zend \\ Mvc \\ Application&#39; - PHP Fatal error: Class 'Zend\Mvc\Application' not found (PHP / Zend)致命错误:在/ foo / path中找不到类&#39;fooClass&#39; - (PHP/Zend) Fatal error: Class 'fooClass' not found in /foo/path 尝试在models / users.php中的zend框架中建立数据库连接时:致命错误:未找到类&#39;Application_Models_Users&#39; - when trying establish a database connection in zend framework in models/users.php: Fatal error: Class 'Application_Models_Users' not found 致命错误:找不到类&#39;Zend_Log&#39; - Fatal error: Class 'Zend_Log' not found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM