MVC Zend Framework sınıf autoloading çalışmıyor

0 Cevap php

MVC zend çerçevesinde benim ilk web uygulaması bitmiş ve her şey benim localhost üzerinde harika çalışıyor.

So I upload it on server and there is problem with autoloading my class. I get error message when i wanna create object from my class in indexcontroller:

$this->view->bottomCache = new Application_Model_Cache($this->cacheTime,'bottomCache');

Ve ben bu yanıl msg olsun:

Fatal error: Class 'Application_Model_Cache' not found in ........./IndexController.php on line 19

Benim localhost ben Zend Server CE kullanıyorum ve orada çalışıyor.

, I çalışmıyor neden bilmek almak için kontrol ne, bana bazı tavsiyeler verebilir lütfen?

SOLVED: first letter of name of class has to be uppercase, Cache.php

EDIT2: Folder models vs. model As you can see in this example

// application/models/Guestbook.php

class Application_Model_Guestbook
{

EDIT1: I used tutorial on http://framework.zend.com/manual/en/learning.quickstart.create-project.html, so i used file structure which is there.

quickstart
|-- application
|   |-- Bootstrap.php
|   |-- configs
|   |   `-- application.ini
|   |-- controllers
|   |   |-- ErrorController.php
|   |   `-- IndexController.php
|   |-- models
|   |   |-- cache.php
|   |   `-- DbTable
|   |       `-- Downloaded.php
|   `-- views
|       |-- helpers
|       `-- scripts
|           |-- error
|           |   `-- error.phtml
|           `-- index
|               `-- index.phtml
|-- library
|-- public
|   |-- .htaccess
|   `-- index.php

Bootstrap.php In my boot strap i have got:

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
  protected function _initAutoload() {

        $autoloader = new Zend_Application_Module_Autoloader(array(
                    'namespace' => 'Application_',
                    'basePath' => dirname(__FILE__),
                ));;
        $autoloader->addResourceType('model', 'model/', 'Model');
        return $autoloader;
  }

  protected function _initDoctype()
  {
    $this->bootstrap('view');
    $view = $this->getResource('view');
    $view->doctype('XHTML1_TRANSITIONAL');
  }
}

application.ini

[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
phpSettings.date.timezone = "Europe/London"
resources.db.adapter = PDO_MYSQL
resources.db.params.host = localhost
resources.db.params.username = *****
resources.db.params.password = ****
resources.db.params.dbname = *****
resources.db.params.charset = "utf8" 
resources.db.params.names = "utf8" 
resources.view.doctype = "XHTML1_TRANSITIONAL"

[staging : production]

[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1

[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1

0 Cevap