Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Class not found error
  • I have a website that i tested offline with apache. It all works perfect.
    The problem however is when i put it online. It keeps giving errors on all classes i import with 'use'. For instance it gives me the following error:
    ErrorException [ Error ]: Class 'Model\types\licenses' not found[code] When is use the code for the Model: namespace Model\types; class Licenses extends \Model { public static function getType() { return '763292375'; } } And for my controller: use Model\types\Licenses; class Controller_Public_Home extends Controller { public function action_index() { $view = View::forge('public/service/signup.html.twig'); $view->set('licenseType', Licenses::getType(), false); return Response::forge($view); } }[code]ErrorException [ Error ]: Class 'Model\types\licenses' not found When is use the code for the Model: namespace Model\types; class Licenses extends \Model { public static function getType() { return '763292375'; } } And for my controller: use Model\types\Licenses; class Controller_Public_Home extends Controller { public function action_index() { $view = View::forge('public/service/signup.html.twig'); $view->set('licenseType', Licenses::getType(), false); return Response::forge($view); } }[code] When is use the code for the Model:
    namespace Model\types;
    class Licenses extends \Model {
    public static function getType() {
    return '763292375';
    }
    } And for my controller:
    use Model\types\Licenses;
    class Controller_Public_Home extends Controller
    {
    public function action_index()
    {
    $view = View::forge('public/service/signup.html.twig');
    $view->set('licenseType', Licenses::getType(), false);
    return Response::forge($view);
    }
    }
  • Why does the error message mention "Model\types\licenses" (lower case) while the "use" statement mentions "Model\types\Licenses"?
  • That seems to be a error on my part.
    But it doesnt seems to be a problem on my windows machine. I did discover what the problem was.
    The server i'm running the website on seems to be linux server, and i started my filename with an uppercase. I should have been a lower case.
  • that would have been my next question. :-)

Howdy, Stranger!

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

In this Discussion