Joe--thanks for your input.

My include path is (1) the library dir where ZF is located, (2) the
/application/models dir and (3) "."

I'm a little unclear when you say "once it knows path to application it will
figure out path to models": wouldn't this also be the case if instead of
using /application as an include_path, I would use /application/models and
get same result for classes in the models dir?

Right now this is working:

require_once '../application/models/LoginForm.php';
$login = new LoginForm();

Stepping back a level, it seems like Zend_App is automagically setting up an
autoloader for each path in the include_path?  Is this correct?  Docs aren't
very clear on this...



joedevon wrote:
> 
> 
> spaceage wrote:
>> 
>> Its the default structure as setup by Zend_Tool:
>> 
>> /application
>>     bootstrap.php
>>     /configs
>>     /controllers
>>     /layouts
>>     /models
>>     /views
>> /library
>> /public
>>     index.php 
>> 
> You don't have a modules directory under application. And I get the
> feeling you don't need a module...you're just trying to get the model to
> autoload, right?
> 
> 
> 
>>         realpath(APPLICATION_PATH . '/models'), 
>> 
> You don't need to include models there. Once it knows the path to
> application, it will figure out the path to models. 
> 
> What is your include path (from the error message)?
> Did you set up APPLICATION_ENV (which is slightly different wording than
> before ZF 1.8)?
> 
> 
>> Without a require_once for my class files in /application/models, I get a
>> Fatal Error, class not found...
>> 
> 
> Where are you putting the require_once in order to get it to work?
> How are you calling the Model?
> 
> Make sure that you name the class in the model like so
> Model_MyName
> 
> NOT Default_Model_MyName as in the quickstart since you don't have Default
> in the Bootstrap...
> 
> Sorry, it can be so many things, so I'm throwing out ideas.
> 

-- 
View this message in context: 
http://www.nabble.com/Zend_Application-and-autoloading-tp23987637p23990389.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to