views:

99

answers:

2

Hi, In zend project have rules default for calling classes that say to put folder class structure before class name.

Example: class Application_Model_DbTable_Albums means: that this class inside folders: Application->Model->DBTable, if its called Just class Albums he will be unrecognized.

How Can be Zend application be configured for more short class without folder location names only class name like class Album and not class Application_Model_DbTable_Albums?

Thank you,

Yosef

+1  A: 

Unless you were to disable the Zend Autoloader and handle this manually (or with a different autoload mechanism), I believe you're stuck.

You could move some of your classes up in structure, however. Our models (e.g. Model_Album) live at application/models/Album.php.

Inkspeak
Must be other way like change settings of Zend
Yosef
@Yosef: If you say `new Album()` Zend will look in certain areas for that class. You can debug through to see where the autoloader is looking (if you're using it) or simple tell it via your include_once or require_once statement.
Inkspeak
Ok, I know that but I looking for method that used but many, and if his not exist (Until know its looks like that) - I think Zend Framework has problem of design or also in other frameworks is same
Yosef
@Yosef, I'm sure the Zend community would be interested in your concerns but based on my experiences with them it seems as if they're intending some formal structure in order to keep Zend as a framework and not just a library. That's a guess however.
Inkspeak
Is it the same with rubi on reils or django? (I dont know this frameworks)
Yosef
@Yosef, Sorry, I don't know those frameworks.
Inkspeak
+1  A: 

You can "use" that way, but you need to "require" each class in your code so they are available on the scope of your script, that way they don't pass via the Autoloader.

Chris