Dave kennedy a écrit :
Now I am tearing my hair out over this. I started refactoring a small project
to 1.8. Before I had included my models directory in the include path so
they could be called whenever wherever.

My structure is

application
 - controllers
 - models
  - Sample.php
 - forms
 - configs
 - layouts
 - views
 - Bootstrap.php
public
 - .htaccess
 - index.php

Im not using a modular structure and do not wish to. I read up on Zend
Application and implemented it with the bootstrap I got a test project
going, my problem is I can no longer autoload my model classes
before I would use $sample = new Sample();

Now I can no longer get that working. I know it is to do with the namespace
autoloading but just cannot get my head round it.... any help would be
greatly appreciated.

Dave


Dave,

I don't think it is the best solution to this problem, but it works : add a namespace to your models :) It makes sense. For example, if you have a model User or whatever, and your application is called App, then call your model App_User. Then, just add the namespace App to your configuration file.

I am not sure it is a good practice though. Maybe it is against Zend Framework philosophy, I don't know. It is up to you ;)
Regards,
Gabriel Malkas, from France.

Reply via email to