Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/asp.net-mvc-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 致命错误:类';Zend\Form\Element';找不到_Php_Zend Framework2 - Fatal编程技术网

Php 致命错误:类';Zend\Form\Element';找不到

Php 致命错误:类';Zend\Form\Element';找不到,php,zend-framework2,Php,Zend Framework2,在我的webapp/index.php中,我定义了include_路径,如下所示: <?php set_include_path(implode(PATH_SEPARATOR, array( 'C:\Program Files\NetBeans 7.1.2\php\library', get_include_path() ))); require_once 'Zend\Form\Fieldset.php'; ?> <htm

在我的webapp/index.php中,我定义了include_路径,如下所示:

<?php
    set_include_path(implode(PATH_SEPARATOR, array(
        'C:\Program Files\NetBeans 7.1.2\php\library',
        get_include_path()
    )));
    require_once 'Zend\Form\Fieldset.php';
?>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
       <?php
            #do something with Fieldset class;
       ?>
    </body>
</html>

感谢您的帮助。

我从未尝试过像那样使用zf(在其mvc之外),但我想您需要设置自动加载器,以便Zend可以找到不同的类

通常,Zend的自动加载器会在\Zend\Form\Element\Text.php中查找类Zend\u Form\u Element\u Text

看一看这本书

 Fatal error: Class 'Zend\Form\Element' not found in C:\Program Files\NetBeans 7.1.2\php\library\Zend\Form\Fieldset.php