View Single Post
  #3 (permalink)  
Old 04-15-2008, 07:21 AM
Mark^Bastard Mark^Bastard is offline
Junior Member
 
Join Date: May 2007
Posts: 15
Default

That sounds good. So you have a base dir, and you wrote a function to scan all children dirs recursively and if one matches the name 'models', it's added to the include path?

That definitely works for me.

One other thing though, do you have any issue with giving your models names without a suffix or prefix?

Shouldn't there be a better way than just new Nodes() for example? I like how controllers have a naming convention of NameController.

I guess I should just use Model as a suffix and deal with the lack of magic.

Ideally I'd like to have...

(default module)

NodeModel.php

class NodeModel extends Zend_Db_Table_Abstract {}

(news module)

News_ArticleModel.php

class News_ArticleModel

If we kept things too generic there may be clashes of class names? Particularly amongst different modules if the idea is to make modules able to be placed in different applications.
Reply With Quote