Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
ErrorException [ Error ]: Class 'Model\Search' not found
  • I moved from my localhost to my web host to test out the application, and everything works as expected but when i tried to use a model that i generated via oil, it throws that error, saying the class doesn't exist, when it does.

    The code i am using:

    use \Model\Search;

    class Controller_Search extends Controller_Template
    {
    public function action_search()
    {
    if ($_POST['Search']) {
    $name['communities'] = Search::query()->where('zip', '=', $_POST['Search'])->get();
    $name['count'] = count($name['communities']);
    $this->template->title = 'Search » Search';
    $name['canShow'] = true;
    $this->template->content = View::forge('search/search', $name);

    } else {
    $name['count'] = 0;
    $this->template->title = 'Search » Search';
    $name['canShow'] = false;
    $this->template->content = View::forge('search/search', $name);
    }
    }

    }
    The question is, What is causing this? and how do i fix it??
  • Is it "Model\Search" or "Model_Search"? You seem to mix those two notations?
  • ohhh, would it just be Search::query.... since i'm caling the class?

    Now i seem to be getting an error about \Model\Search does not exist :(
  • HarroHarro
    Accepted Answer
    You're not coming from a Windows platform and going to a linux platform? If so, have you paid attention to the file naming conventions (all filenames MUST be lower case)?
  • ohhhhh. Yeah i was going to linux. I had absolutely no idea that they had to be lowercase. Thank you!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion