我正在學習Zend Framework。我試圖創建一個自定義視圖助手類,但錯誤說「未定義的類Zend_View_Helper_Abstract」。zend undefined class Zend_View_Helper_Abstract
這是Gender.php存儲在應用程序\意見\傭工\ 它只是返回一個字符串「他」或「她」,這取決於$性別傳遞
<?php
class Zend_View_Helper_Gender extends Zend_View_Helper_Abstract {
public funtion Gender($gender){
if ($gender=='m')
{
return 'he';
}else{
return 'she';
}
}
}?>
我CONFIGS \應用的.ini
[production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
[staging : production]
[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
[development : development]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1
這意味着Zend_View_Helper_Abstract類沒有加載。沒有包含文件,尚未下載文件,或者您的Zend安裝配置錯誤。不幸的是,這與我們在這裏可以告訴的差不多... –