zf框架里使用模块时,控制器里提示找不到模型类
控制器:/modules/members/contorlls/IndexController.php
模型:/modules/members/models/Members.php
用域名http://localhost/members/index/ 访问的时候,提示找不到类"Fatal error: Class 'Members_Model_Members' not found "
已经在application.ini里指定了模块的路径为modules
class Members_IndexController extends Zend_Controller_Action
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
// action body
$user = new Members_Model_Members();
die('Members Index Controllers');
}
}
模型:/modules/members/models/Members.php
<?php
//Shanty_Mongo_Document
class Members_Model_Members extends Shanty_Mongo_Document
{
protected static $_db = 'etour';
protected static $_collection = 'user';
protected static $_row;
protected static $_requirements = array(
'name' => 'Required',
'email' => array('Required', 'Validator:EmailAddress'),
'friends' => 'DocumentSet',
'friends.$' => array('Document:User', 'AsReference')
);
protected function init()
{
parent::__construct();
// Do stuff on initialising document
self::$_row = new Shanty_Mongo_Document();
}
}用域名http://localhost/members/index/ 访问的时候,提示找不到类"Fatal error: Class 'Members_Model_Members' not found "
已经在application.ini里指定了模块的路径为modules
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.frontController.moduleControllerDirectoryName = "controllers"
resources.frontController.defaultModule = "default"
...全文
相关推荐
zf2-base-module:zf2项目的基本模块
### 开发与实践使用zf2-base-module进行开发时,你可以根据项目需求添加自定义的模块、控制器、模型和视图。
Logisim 2.7.1 构建8位模型机CPU:从ALU到控制器的4个核心模块封装
本文基于Logisim 2.7.1设计并封装8位模型机CPU的四大核心模块:ALU(支持算术逻辑运算及标志位生成)、寄存器组(8×8位、双读单写)、硬布线控制器(指令解码与控制信号生成)以及顶层CPU集成。重点涵盖模块化封装、数据通路设计、时序控制与调试方法,适用于计算机组成原理实践教学。
PHP框架之Zend Framework框架
ZendFramework是一个服务器端PHP框架,采用MVC架构,提供模块化、灵活性高和企业级功能,支持多种数据库系统,具备自动加载和强大的路由系统,适用于构建稳定、安全的Web应用程序。
ESXi 直通 nvme 控制器导致系统盘无法访问的解决办法
本文详述了一次ESXi系统下NVMe控制器直通操作引发的问题及解决过程。因直通系统盘所在控制器,导致ESXi无法保存配置,包括取消直通的设置。通过使用Live系统挂载ESXi分区,修改state.tgz文件中的配置,最终解决问题。
zf2 框架的模版一个模版实例
**路由与视图策略**:最后,确保你已经设置了路由,使得当用户访问特定URL时,控制器能被正确调用。


Framework
