我正在从zendCast学习zend框架,但找不到问题
我正在使用:
-Zend Server CE
-Zend Studio 7.2
-Zend Framework 1.10(使用zend studio创建)
在我的库文件夹中,我有一个文件夹App,在该文件夹中有一个php文件Countries.php,它对应于App_Countries类但是当我尝试创建一个新的App_Countries对象时,它表示该类无法加载任何有关如何的想法摆脱错误?
Fatal error: Class 'App_Countries' not found in /usr/local/zend/apache2/htdocs/ZC/application/controllers/IndexController.php on line 14
的index.php
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
get_include_path(),
)));
/** Zend_Application */
require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
$application->bootstrap()
->run();
答案 0 :(得分:5)
确保在application.ini中正确配置了autoloadernamespace 它应该包含这样的内容:
autoloadernamespaces[] = "Zend"
autoloadernamespaces[] = "App"