views:

35

answers:

1

after starting with zend framework for sometime, i started to think which classes shld be put where, in the /library or /application?

i think that reusable classes shld go to /library and application specific to /application? am i correct?

1 thing that i find more troublesome when using /application is that its not in the include path and i need to create a resource loader for it? eg.

$resourceLoader = new Zend_Loader_Autoloader_Resource(array(
    'namespace' => 'Application_',
    'basePath' => dirname(__FILE__)
));
$resourceLoader->addResourceType('validator', 'validators/', 'Validator');
$resourceLoader->addResourceType('acl', 'acl/', 'Acl');
A: 

You're right!

/Library for more generic classes. Like the ones of Zend Framework, and /Application for application specific classes.

And yes, you need to register namespaces and add resources. So that Zend Autoloader can look inside these folders and require than. If all folders were automatically registered, the autoloader could load more slowly.

Keyne