我的申请文件:
<?php // /src/app.php
require_once __DIR__ . '/../lib/vendor/Sensio/silex.phar';
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Foo\Bar;
$app = new Silex\Application();
$app['autoloader']->registerNamespace('Foo', __DIR__);
$bar = new Bar();
(...)
我的酒吧课:
<?php /src/Bar.php
namespace Foo;
use Silex\Application;
use Silex\ControllerProviderInterface;
use Silex\ControllerCollection;
use Symfony\Component\HttpFoundation\Response;
class Bar implements ControllerProviderInterface { ... }
当我$bar = new Bar()
在 myapp.php
中执行 a 时,出现错误:Fatal error: Class 'Moken\Classname' not found in (...)/src/app.php on line 11
谁能告诉我我做错了什么?