Issues

ZF-12372: Documentation to autoloading is not helpful for an autoloading noob

Description

Hey,

i think the documentations for The Autoloader and Resource Autoloaders should be improved. I have had no idea how autoloading works before I started to work with Zend. Still, when I started to read the autoloding docs, I expected to grasp the concept easily. Actually, it took me lots of time and I needed to read some other resources and try lots of things myself. The way autoloading works in Zend was totally counterintuitive to me even after going through the manual several times.

I think the missing thing in the docs is: "how it actually works". For Zend_Loader_Autoloader I would like to see there the following information: - if I introduce a class name with a registered prefix, the autoloader searches for it in php include paths - for the class to be found its name must match (after substitution of / for _) the relative path from the include path under which it resides (+ example to clear this out)

For Resource Autoloaders I would mention that it has no relation to php include paths (afaik) and that its functionality stands and falls on the added resource types. I would except a thing like: $resourceLoader = new Zend_Loader_Autoloader_Resource(array( 'basePath' => WEBSITE_PATH, 'namespace => 'Website'));

without any added resource types to do something like adding WEBSITE_PATH to include paths and registering namespace Website so that I can do new Website_Model_Foo immediately. Well it does not work like that and it would be nice to clear that out in the docs.

Thank you for the great project.

Comments

Version 2 is around the corner and I think there will be no further major improvements for the ZF1 docs.