私のアプリケーションファイル:
<?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()
とapp.php
、エラーが発生します。Fatal error: Class 'Moken\Classname' not found in (...)/src/app.php on line 11
誰かが私が間違っていることを教えてもらえますか?