簡體   English   中英

在庫文件夾中找不到Zend Framework 1.10自定義類

[英]Zend Framework 1.10 custom Class inside library folder not found

我正在從zendCast學習zend框架,但找不到問題

我正在使用:

-Zend服務器CE

-Zend Studio 7.2

-Zend Framework 1.10(使用zend studio創建)

在我的庫文件夾中,我有一個應用程序文件夾,在該文件夾中有一個與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

// 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();

確保在您的application.ini中正確配置了autoloader命名空間。
它應包含以下內容:

autoloadernamespaces[] = "Zend"
autoloadernamespaces[] = "App"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM