OK, this makes sense, but its still failing...

In index.php, I have:

defined('APPLICATION_PATH')
    || define('APPLICATION_PATH', realpath(dirname(__FILE__) .
'/../application'));

and

set_include_path(implode(PATH_SEPARATOR, array(
    realpath(APPLICATION_PATH . '/../library'),
    get_include_path(),
)));


In my controller, I have:

$login = new Model_LoginForm();


and in models/LoginForm.php, I have:

class Model_LoginForm extends Zend_Form
...

no dice...no includePaths are active in application.ini.

I think I like this whole Zend_Application thing ???




joedevon wrote:
> 
> 
> spaceage wrote:
>> 
>> My include path is (1) the library dir where ZF is located, (2) the
>> /application/models dir and (3) "."
>> 
> You don't need /application/models in the path. Remove the line that sets
> it. It's just adding an extra path to slow down the system a bit.
> 
> 
> 
>> 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?
>> 
> In /public/index.php, this line defines APPLICATION_PATH:
> 
> defined('APPLICATION_PATH')
>     || define('APPLICATION_PATH', realpath(dirname(__FILE__) .
> '/../application'));
> 
> that's all it needs to know.
> 
> 
> Right now this is working:
>> 
>> require_once '../application/models/LoginForm.php';
>> 
> Remove the require line
> 
> 
> $login = new LoginForm();
> change to $login = new Model_LoginForm
> and make sure in /application/models/LoginForm.php' the class is defined
> thusly:
> class Model_LoginForm
> 
> and hopefully you should be all set.
> 
> 

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

Reply via email to