0
對不起,我的英文,但請幫助我。我如何在模塊中找到模型。我使用Zend Framework 1.12,並在命令行中運行php文件。示例代碼:Zend Command Line無法在模塊中找到模型
//file located in project/scripts/test.php
<?php
//ini_set("display_errors","1"); ini_set("error_reporting", E_ALL);
// Initialize the application path and autoloading
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', $argv[1]);
set_include_path(implode(PATH_SEPARATOR, array(
APPLICATION_PATH . '/../library',
get_include_path(),
)));
require_once 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance();
// Initialize Zend_Application
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
//this model i can find
$sendQueueModel = new Application_Model_DbTable_SendQueue();
//but this i can't. Managers - this is module in project
$managersMOdel = new Managers_Model_Company();
檢查這可以幫助你 - http://stackoverflow.com/questions/1836447/zend-modules-models/1837722#1837722 – janenz00