Hi all,
This is a general question for understanding about MVC structure and the
Zend Framework.
In general, I understand MVC. So here's the thing. I'm working on a
product database. A pretty common thing for websites, I suppose.
I'm thinking over how best to create models to manage this data easily via
the controller and I'm reading over Zend_Db (again) to gain more
understanding.
The Zend_Db reference guide gives an example of "Bugs". You have a "Bugs"
tables and they create a class called "Bugs" that extends the
Zend_Db_Table_Abstract class.
My first question is, is this a Model? Would it then be stored in the
standard directory "/application/models/"?
I'm use to saving models out like "My_Model_ModelName". This is how I
understand how to do it because it works with Zend AutoLoader as my
bootstrap his this code:
----
$resourceLoader = new Zend_Loader_Autoloader_Resource(array(
'basePath' => APPLICATION_PATH,
'namespace' => 'My',
));
$resourceLoader->addResourceType('models', 'models/', 'Model');
----
So, if I were to do something like the Zend_Db_Table reference guide
example, how would I get the autoloader to recognize a file simply as "Bugs"
if I don't have a path / namespace prefix on the file name? The only way I
can think of doing that would be to have the "/models" directory as part of
the path to check for classes or to manually load the class before using it.
So is the Zend_Db_Table reference simply written for brevity and they sort
of skip the step of how to connect it to Zend Autoloader and assume that you
load the class manually in the controller before hand? I suppose that's
where I start to get confused and I want to make sure I'm doing things a
good way.
Thanks for helping clarify my confusion on MVC structure!
Cheers!
--
View this message in context:
http://zend-framework-community.634137.n4.nabble.com/ZF-models-and-Zend-Db-classes-tp3049177p3049177.html
Sent from the Zend Framework mailing list archive at Nabble.com.