[英]Zend Framework 1.10 custom Class inside library folder not found
I'm learning zend framework from zendCast and can't find the problem 我正在从zendCast学习zend框架,但找不到问题
I'm using: 我正在使用:
-Zend Server CE -Zend服务器CE
-Zend Studio 7.2 -Zend Studio 7.2
-Zend Framework 1.10 (created with zend studio) -Zend Framework 1.10(使用zend studio创建)
In my library folder I have a folder App and in that folder a php file Countries.php which corresponds to App_Countries class but when I try to create a new App_Countries object it says that class could not be loaded any ideas on how to get rid of the error? 在我的库文件夹中,我有一个应用程序文件夹,在该文件夹中有一个与App_Countries类相对应的php文件Countrys.php,但是当我尝试创建一个新的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 的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();
Make sure the autoloadernamespace is properly configured in your application.ini. 确保在您的application.ini中正确配置了autoloader命名空间。
It should contain something like this: 它应包含以下内容:
autoloadernamespaces[] = "Zend"
autoloadernamespaces[] = "App"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.