php - "Cannot redeclare class" issue in FuelPHP -


working namespaces in default fuelphp installation add following welcome controller (otherwise unedited) , start getting error:

errorexception [ compile error ]: cannot redeclare class fuel\controller\welcome" 

the code is:

<?php  namespace fuel\controller;  use fuel\core\controller;   class welcome extends controller { ... } 

this beginner's question can't figure out why collision occurring , have tried can think of.

edit: tried putting following code in front of class , error disappeared generic looking 404 page displayed. (not 1 displayed default fuelphp black/grey one)

if (class_exists("controller\welcome",false)) { //    echo "here. (" . __file__ . ":" . __line__ . ")\n";  } else {     //class definition...  } 

the answer turned out have change controller prefix in config file following:

  'controller_prefix' => 'controller\\', 

which written in documentation. (silly me)


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -