If you're using the module resource
autoloader<http://framework.zend.com/manual/en/zend.loader.autoloader-resource.html#zend.loader.autoloader-resource.module>,
the default location for classes that extend Zend_Db_Table_Abstract can be
autoloaded from:

application/models/DbTable/

Your classes would then be prefixed with {namespace}_Model_DbTable_

So if you're using the autoloader namespace "Default" and want to autoload a
db table named "Foo", your class name would be:

Default_Model_DbTable_Foo

And it would be placed in:

application/models/DbTable/Foo.php

You don't have to follow this convention but this is how it would work "out
of the box".

I hope this helps!

--
*Hector Virgen*
Sr. Web Developer
http://www.virgentech.com



On Thu, Nov 18, 2010 at 1:31 PM, Fozzyuw <[email protected]> wrote:

>
> Hi Bill,
>
> First, thank you very much for your response as well as your contributions
> to the Zend Framework.  I know I use the reference guide daily, that you
> wrote, in my pursuit of getting better at ZF.
>
> I believe you answered one of my long standing confusions of MVC structure
> in understanding what a Model really is.  Are they all things other than
> Controller/Views Models?  Clearly because there are situations were you
> simply have a Table/Data access class, not really a Model of an object,
> like
> a product (which could have multiple data access classes depending on how
> the database and object was designed).
>
> Your explanation made sense to me.
>
> Regarding class loading.  I suppose that was just a different confusion
> I've
> had and I tend to think of things as a whole.  But I appreciate your
> response to that question.  In many ways, as I work more with MVC I start
> to
> question myself if I shouldt be using something like a "require_once"
> because I start to feel that there should be "Zend FrameworK" way of doing
> it, like auto-loading.
>
> Cheers!
> --
> View this message in context:
> http://zend-framework-community.634137.n4.nabble.com/ZF-models-and-Zend-Db-classes-tp3049177p3049627.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>

Reply via email to