Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Class 'Model\DB' not found
  • Class 'Model\DB' not found
    i am trying to create a model , and trying to access through that model.
    here is the link

  • HarroHarro
    Accepted Answer
    You need to read up on using namespaces in PHP.

    The DB class is in the global namespace. This error message indicates your current namespace is "\Model", in which there is no class called DB.

    When you are in a namespace, and you need to access Fuel classes, you need to access them from the global namespace, by prefixing them with a backslash:

    \DB::select()->...

Howdy, Stranger!

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

In this Discussion