Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
ErrorException [ Error ]: Class 'Controller_TemplateExt' not found
  • Hello, I already have a fuel application working properly in my localhost. Though now that I am trying to put it in my remote host (dreamhost) I'm getting the following error ErrorException [ Error ]: Class 'Controller_TemplateExt' not found Where TemplateExt is a class of mine that extends Controller_Template, and I use for before and after methods. It's in app/classes/controller/templateExt.php. The line that calls it is this one: class Controller_Salon extends Controller_TemplateExt {
  • Is your development environment Windows by any chance? Windows is not case-sensitive, whereas Linux is. Try renaming your controller to "templateext.php" (lowercase E). Also, if you're extending the template controller, I think the standard approach with FuelPHP is to call the controller "Controller_Template" (same name as the core class) and make it extend the core one:
    class Controller_Template extends Fuel\Core\Controller_Template
    {
        // ...
    }
    
    And add it to the Autoloader::add_classes section in your bootstrap.php. See http://docs.fuelphp.com/general/extending_core.html for more details on that. If you do it that way, you can still use "extends Controller_Template" in your controllers, and they will automatically use your modified one instead of the Fuel core one.
  • that's it! I am developing on Windows so renaming the file did the trick. I'm also changing the template name as you suggested. Thank you very much.
  • As per the docs (see coding standards), all filenames in FuelPHP HAVE to be lower case. The only exception to this rule are packages that contain vendor libraries and run in PSR-0 mode.

Howdy, Stranger!

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

In this Discussion