Simon, we are discussing this very thing right now in a proposal:

http://framework.zend.com/wiki/display/ZFPROP/Zend_Loader_Autoloader_Resourc
e+-+Matthew+Weier+O%27Phinney

Let me first mention that within a module the classes always start with

SomeModuleName_....

> Just a question really on how others do the same sort of thing... That being
> the loading of forms, models and anything else outside the immediate ZF
> fold. I have my modules and each has a model and form directory, then any
> other directories for resources. I thought it would be a good idea to use
> the autoloader to load these.
> 
> Everything is called... Module_Form_Name (module being the module name, form
> being the resource and name being a unique name). All works well except of
> course module directories are lower case and my server wants the files cased
> properly!

That's exactly the type of thing we are gonna attempt to autoload.  There
will be an explicit mapping of application resources to class files.
Personally, I do like lowercased-dashed directories in my project, as to me
it makes the most sense from a filesystem persepctive. (I've seen it done
lower_underscored as well.

> I have three options as I see it.
> 
> 1) Upper case my module directories (although I want lower case urls).
> 
> 2) Create loader helpers to load everything (currently I've done this but
> with a twist so it still uses Zend_Loader as it lower cases the first letter
> of each resource... module_Form_Name ... Seems messy!) This is also long
> winded when the autoloader does such a  good job.
> 
> 3) Require everything.
> 

Yep, different people do any one two and three above, they are both pretty
common solutions.

Have a look at the proposal and add your notes there.  You can also track
the development (matthew has a prototype linked in there believe).

-ralph


-- 
Ralph Schindler
Software Engineer     | ralph.schind...@zend.com
Zend Framework        | http://framework.zend.com/


Reply via email to