may be you cud use something like this.. in your bootstrap
define('_PATH_MODEL','path/to/model/');// you cud put this in ur config file
or something.. .
/* load Zend Loader */
include_once('Zend/Loader.php');
/* auto load classes */
function __autoload($_class)
{
try {
Zend_Loader::loadClass($_class, array(_PATH_MODEL,_OTHER_PATHS));
} catch (Exception $e) {}
}
On 6/24/07, delsvr <[EMAIL PROTECTED]> wrote:
There are a lot of general, philosophical posts discussing this topic, but
I
haven't found a real answer to this problem, yet.
My directory structure looks something like this:
app
-modules
-module1
-controllers
-models
-views
-module2
(etc.)
html
-index.php (bootstrap)
library
How should I go about adding the models directory to my include path? The
path is set during bootstrap, and it currently includes: './' and
'../library'. For the time-being I've created a "models" directory under
"app," and I've added '../app/models' to the path, but this is not
desirable.
I'm trying to use include models in a controller, under the "controller"
directory, that would look something like:
include_once('../models/Model.php');
and that would reference the model under that specific module's directory.
Thanks,
delsvr
--
View this message in context:
http://www.nabble.com/Including-Models-tf3970638s16154.html#a11270727
Sent from the Zend Framework mailing list archive at Nabble.com.