views:

125

answers:

2

i have next folder structure zf version 1.10

/application
 /config
  application.ini
 /Forms
 /Layouts
 /modules
    /default
     /controllers
     /models
      manufactur.php
     /view
     bootstrap.php
 bootrstrap.php

apllication.ini have next content

includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules/"
resources.modules = ""

/modules/bootstrap.php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
        protected function _initAutoload()
        {
                $resourceLoader = new Zend_Loader_Autoloader_Resource(array(
                'basePath' => APPLICATION_PATH.'/modules/default' ,
                'namespace'=> '',
                'resourceTypes'=>array(
                'form'=>array(
                'path'=>'Forms',
                'namespace'=>'Form')))
                );
                 }
}

/modules/default/bootstrap.php

class Default_Bootstrap extends Zend_Application_Module_Bootstrap
{

}

/default/models/manufactur.php

class Manufactur extends Zend_Db_Table_Abstract
{
    protected $_name = 'manufacturers';
    protected $_primary = 'id';

}

When i in any controller trying $a = new Manufactur() i see Error not find class

when i before call use include 'path/to/manufactur.php' all work fine

Any idea why it can be ?

A: 

You will have to add your models folder to the include_path or register that path with an autoloader.

Daniel Egeberg
to any modular i must register one more include path ?
alexandr
Well, the autoloader needs to know where to look for it. It has to know *somehow*.
Daniel Egeberg
If i have 5 part how i must registry 5 path it basic structure mvc i controllers and view work fine but wy wrong with models ?Where i must register new path ? in mudules/bootstrap.php or default/bootstrap.php ?
alexandr
A: 

Problem solved No need any

You will have to add your models folder to the include_path or register that path with an autoloader.

just prefix in class name like

Default_Model_Manufactur

and all work fine

alexandr