I don't really know if this will help or not but here's a way to load models.
/application/modules/default/controllers
PHP Code:
<?php
class IndexController extends Zend_Controller_Action
{
protected $_loader = '';
public function init()
{
$this->_loader = new Zend_Loader_PluginLoader();
$this->_loader->addPrefixPath('Default', './application/modules/default/models');
}
public function indexAction()
{
$db = Zend_Registry::get('db');
$loader = $this->_loader;
$class = $loader->load('UserModel');
$user = call_user_func(array($class, 'getInstance'), $db);
}
}
?>
in the /application/modules/default/models directory
PHP Code:
<?php
class Default_UserModel extends Zend_Db_Table
{
protected $_name = "users";
protected $_primary = "pu_id";
public static function getInstance($db)
{
return new Default_UserModel($db);
}
}
?>
Bookmarks