Hi all,

I'm having some difficulty understanding how the application Autoloader
works and how resources are loaded. Reading the docs, I've gathered that
resource autoloaders register themselves with associated namespaces and the
user can then add directory paths to specific resources that they have.

So, from what I understand, if you have some classes in a directory (let's
say Login.php is located in path/to/some/directory/forms/Login.php) you have
to instantiate the Zend_Loader_Autoloader_Resource with that directory and
the namespace that is used for the Login class, and then add the specific
'form' component by calling the addResourceType() method.

In my case, I have created a directory in the application/ folder called
store/. So my path is application/store/ I have some classes in that
directory that I would like to have loaded so that I can use those classes
in my controllers and models. I've named the classes according to the folder
structure as mentioned in the docs. So the class in
application/store/Test.php is called Application_Store_Test.

I tried adding this path to the resource autoloader the way that it was done
in the docs, but I can't get the class loaded. Right now, for a model/ class
to see the store/ class, I have to require() it and symlink it.

First of all, I don't know what the idiomatic way of adding a new directory
under the application/ directory is and if indeed the resource autoloader is
required, I'm not sure how to use it. The Application instantiates a
resource autoloader called Zend_Application_Module_Autoloader, but I can't
get access to that instance, which means that I'm probably trying to do the
wrong thing.

Sorry for the long post...

Regards,

Adnan


--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/Loading-non-default-Resources-in-the-Autoloader-tp4299613p4299613.html
Sent from the Zend Framework mailing list archive at Nabble.com.

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to