Php 致命错误:类';Zend\Form\Element';找不到
在我的webapp/index.php中,我定义了include_路径,如下所示: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
<?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