/php/FrontController.php
namespace FrontController;
class FrontController {
public static function add($a, $b)
{
return $a+$b;
}
}
/project/index.php
use FrontController;
echo FrontController::add(4,5);
error message:
Warning: The use statement with non-compound name 'FrontController' has no effect in C:\wamp\www\project\index.php
Fatal error: Class 'FrontController' not found in C:\wamp\www\project\index.php
I want to use namesapces instead of include and include_once but I keep having this kind of problems..
use ../php/FrontController.php; <-- syntax error occurs so I can't specify the file location..
I don't know what I have done wrong.. please help!