/php/FrontController.php

``````namespace FrontController;
class FrontController {
{
return \$a+\$b;
}
}
``````

/project/index.php

``````use FrontController;
``````

error message:

``````    Warning: The use statement with non-compound name 'FrontController' has no effect 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..

Edited by 9tontruck

2
Contributors
3
Replies
19
Views
4 Years
Discussion Span
Last Post by 9tontruck

If you use namespaces you want have to require or to have a autoloader class ? ust use logic .. you provided those data in a file … in somehow that file should be read..

Edited by jkon