简体   繁体   中英

Zend framework Class 'Model_DbTable_indexview' not found in <Directory>

I just installed a script i purchased and i'm facing issues with the file not found. I checked the function and Model_DbTable_indexview do exist in the model folder. Is there anywhere that i should be looking at ? Any hints would be greatly appreciated. Thank you!

This function is used to get the page url

*/ function curPageURL()
{
    $pageURL = 'http'; 

    if ($_SERVER["HTTPS"] == "on")
        $pageURL .= "s";

    $pageURL .= "://"; 

    if ($_SERVER["SERVER_PORT"] != "80") 
    {
        $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; 
    }
    else
    {
        $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; 
    } 
    return $pageURL;
}

Fatal error: Class 'Model_DbTable_indexview' not found in /opt/bitnami/apps/heroku/htdocs/application/controllers/IndexController.php on line 12

You are not using 'application' namespace also not following ZF class naming convention , so do this rename your class to

Application_Model_DbTable_IndexView

And change file name ot

IndexView.php

检查类文件是否存在于:

/opt/bitnami/apps/heroku/htdocs/application/models/dbtable/indexview

Under default settings for autoloader and appnamespace , the class

Application_Model_DbTable_SomeModel

should reside in the file

application/models/DbTable/SomeModel.php

In particular, note the mixed-case for DbTable in both the classname and the path, as well the plural models in the path.

You need to confirm (including upper/lowercase) all of the following:

  1. Class name: Application_Model_DbTable_SomeModel
  2. File and path : application/models/DbTable/SomeModel.php

Then the autoloader will allow you to instantiate (in a controller, say) by using:

$model = new Application_Model_SomeModel();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM