0

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

tereško
  • 58,060
  • 25
  • 98
  • 150
CodeGuru
  • 3,645
  • 14
  • 55
  • 99

3 Answers3

2

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
Mr Coder
  • 8,169
  • 5
  • 45
  • 74
  • The error will still be there. Suspecting that the model isnt loaded? Is that how Zend work? – CodeGuru Jun 01 '13 at 09:38
  • you have still not changes the indexView to IndexView , Also make sure the file is located at /opt/bitnami/apps/heroku/htdocs/application/models/DbTable/IndexView.php – Mr Coder Jun 01 '13 at 09:44
  • since you are on *nix system its important to hv every file/folder is in correct letter case . for e.x it shd be DbTable not dbtable . – Mr Coder Jun 01 '13 at 09:47
  • I fixed the CAPS, still the same set of error. Thanks for your help here :) – CodeGuru Jun 01 '13 at 10:02
1

Check if the class file iven exists in:

/opt/bitnami/apps/heroku/htdocs/application/models/dbtable/indexview
Mieszko
  • 56
  • 1
1

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();
David Weinraub
  • 14,144
  • 4
  • 42
  • 64