Here's the "default" autoloader as output from xdebug...note that is using a
namespace of 'My_' in the Zend_Application_Module_Autoloader object (so not
exactly default). Hopefully a cleaned up explanation of this will make it
into the online manual soon:
object(Zend_Application_Module_Autoloader)[7]
protected '_basePath' => string '../application' (length=14)
protected '_components' =>
array
'My_Model_DbTable' => string '../application/models/DbTable'
(length=29)
'My_Form' => string '../application/forms' (length=20)
'My_Model' => string '../application/models' (length=21)
'My_Plugin' => string '../application/plugins' (length=22)
'My_Service' => string '../application/services' (length=23)
'My_View_Helper' => string '../application/views/helpers'
(length=28)
'My_View_Filter' => string '../application/views/filters'
(length=28)
protected '_defaultResourceType' => string 'model' (length=5)
protected '_namespace' => string 'My' (length=2)
protected '_resourceTypes' =>
array
'dbtable' =>
array
'namespace' => string 'My_Model_DbTable' (length=16)
'path' => string '../application/models/DbTable'
(length=29)
'form' =>
array
'namespace' => string 'My_Form' (length=7)
'path' => string '../application/forms' (length=20)
'model' =>
array
'namespace' => string 'My_Model' (length=8)
'path' => string '../application/models' (length=21)
'plugin' =>
array
'namespace' => string 'My_Plugin' (length=9)
'path' => string '../application/plugins' (length=22)
'service' =>
array
'namespace' => string 'My_Service' (length=10)
'path' => string '../application/services' (length=23)
'viewhelper' =>
array
'namespace' => string 'My_View_Helper' (length=14)
'path' => string '../application/views/helpers'
(length=28)
'viewfilter' =>
array
'namespace' => string 'My_View_Filter' (length=14)
'path' => string '../application/views/filters'
(length=28)
spaceage wrote:
>
> Joe--I have to study this more closely, but from the table you have
> provided, it would appear that certain assumptions are being made by the
> autoloader I'm not aware of...too bad this table isn't in the docs ;-)
> Thanks--I will study your suggestions and see if I can end my 2 day loss
> of time.
>
>
>
>
> joedevon wrote:
>>
>>
>> spaceage wrote:
>>>
>>> I should add that 'model' and 'models' were being used interchangeably
>>> in both of our posts, and I've updated everything to be
>>> 'models'/'Models' throughout...
>>>
>> I don't know how I missed this post...I wasn't using model and models
>> interchangeably...You need to remove plural from new Models_Login to
>> Model_Login and also no plural in the class....
>>
>> Taking from Rob's excellent tutorial:
>>
>> The module autoloader will autoload classes with a certain prefix that
>> are in
>> certain directories within application/ as per this table:
>>
>> Directory | Prefix | Example
>> =================================
>> api | Api_ | Api_Rest
>> forms | Form_ | Form_Login
>> models | Model_ | Model_News
>> models/DbTable | Model_DbTable_ | Model_DbTable_News
>> plugins | Plugin_ | Plugin_
>>
>> Hope that table comes out ok...so according to this, the autoloader looks
>> in the file and reads the class name, so putting zend form in the models
>> directory is messing you up unless I read Rob incorrectly....
>>
>
>
--
View this message in context:
http://www.nabble.com/Zend_Application-and-autoloading-tp23987637p24039315.html
Sent from the Zend Framework mailing list archive at Nabble.com.