Matthew Weier O'Phinney schrieb: >>>> How about a controller plugin that dynamically adds model directory >>>> to the include path for a current module? That's something trivial >>>> to do. >>> The problems of using the include_path remain: it grows, making file >>> resolution slower, and it makes it more difficult to namespace models >>> with a common module prefix. >> And how about using a singleton class for model handling? :) >> Sorry for asking again, but I really want to know whether it's okay or >> completely out of scope ... :))
> Honestly, I'm not sure I understand what you're getting at. I need more > details on how it works. (Yes, I understand "singleton"; I just don't > understand what it has to do with "model handling".) The class is nothing special: http://paste2.org/p/100000 It just iterates over the directories and loads the models and returns a new instance. The reason why i realized that in a singleton was, that I needed some way to load the models everywhere - and just thought about a way to have access to all models no matter where I need them (in controllers, other classes, view scripts etc) - and that brought me to the singleton class approach. So what's the drawback compared to the plugin approach you mentioned? Ah, I almost forgot: Don't wonder / worry about the code - I just started coding PHP intensively one year ago ... still a long way to go to become a proper and maybe even useful contributor ... :P -- Cheers, \\|// Vince (o o) ----------------------------ooO-(_)-Ooo------------------------- ''' (o)_(o) [ ][0][ ] ô¿ô (=°o°=) World Domination by Copy and Paste [ ][ ][0] - (")_(") [0][0][0] () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments Ooo. ---------------------------.ooO----( )------------------------- ( ) (_/ \_)
