[英]Why am I getting Application error while trying to load a model?
I've run this code 我已经运行了这段代码
Zend_Loader::loadClass("Admin_Models_DbTable_News");
and my application has this folder structure 我的应用程序具有此文件夹结构
Why do I get this: 为什么我得到这个:
Zend Framework ships with a concrete implementation of Zend_Loader_Autoloader_Resource that contains resource type mappings that cover the default recommended directory structure for Zend Framework MVC applications. Zend Framework随附Zend_Loader_Autoloader_Resource的具体实现,其中包含资源类型映射,这些映射涵盖Zend Framework MVC应用程序的默认建议目录结构。
This loader, Zend_Application_Module_Autoloader, comes with the following mappings: 该加载器Zend_Application_Module_Autoloader带有以下映射:
forms/ => Form
models/ => Model
DbTable/ => Model_DbTable
mappers/ => Model_Mapper
plugins/ => Plugin
services/ => Service
views/
helpers => View_Helper
filters => View_Filter
Given your example, your class should be called "Admin_Model_DbTable_News" . 给定您的示例,您的类应称为“ Admin_Model_DbTable_News” 。 Note that the "s" is left out.
请注意,省略了“ s”。 This class should be put in application/modules/admin/models/DbTable/News.php
此类应放在application / modules / admin / models / DbTable / News.php中
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.