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_Panel' not found
  • Hello, I'm getting the following error: ErrorException [ Error ]: Class 'Controller_Panel' not found. Controller_Panel extends Fuel\Core\Controller_Hybrid and has only before() method.
    I've tried adding it to Autoloader::add_classes section in bootstrap.php file. Then I got error: Call to undefined method ReflectionClass::newInstance().
    It was working in fuelphp 1.5.3 but I've upgraded fuelphp to 1.6.1
  • Where is this class in the file system (path and filename)? And how is it defined?

    There have been no changes in how classes are loaded (that would be a major break of backward compatibility).

    Looking at the name it should be in app/classes/controller/panel.php and defined as

    class Controller_Panel extends \Controller_Hybrid {}

    p.s. NEVER access classes in \Fuel\Core, it can seriously break everything!
  • It is located in app/classes/controller/panel.php as you said, but defined as

    class Controller_Panel extends Fuel\Core\Controller_Hybrid {}
    I've just tried 'extends \Controller_Hybrid {}' but nothing has changed.
  • You haven't changed the controller prefix in your config? Your COREPATH definition in your index.php is still correct? Do other controllers work?
  • No, I haven't changed controller prefix. All other controllers extends Controller_Panel.
    Ex. My home controller; Controller_Home extends Controller_Panel {}
    I've tried adding it to Autoloader::add_classes section in bootstrap.php file. Then I got error: Call to undefined method ReflectionClass::newInstance().
  • Are you sure you're running PHP 5? FuelPHP requires 5.3.3+.

    ReflectionClass::newInstance() is a class build into PHP 5+, It must be defined.

    That may also explain the other issue, pre PHP5 diidn't do namespaces.
  • Fuelphp 1.5.3 is still running without an error. And phpinfo says pho version is 5.3.8
  • Then I'm out of idea's.

    Nothing really significant has been changed between 1.5 and 1.6, certainly nothing that would break existing controllers.
  • I've found the problem. It's a php bug but not still fixed https://bugs.php.net/bug.php?id=35050

    I have a controller Controller_Instantgram which is located in app/classes/controller/instantgram.php and I'm using tr_TR as locale.

    I've added

    setlocale(LC_CTYPE, 'C');

    to core/classes/fuel.php after

    setlocale(LC_ALL, static::$locale) or logger(\Fuel::L_WARNING, 'The configured locale '.static::$locale.' is not installed on your system.', __METHOD__);

    as said in http://www.topolis.lt/php/#35050 and it's working.

Howdy, Stranger!

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

In this Discussion