خرید بک لینک

Vote count: 0

I have a custom controller provider class that is working fine. I've tried adding a second one and it just keeps saying:

Fatal error: Class 'BarBarControllerProvider' not found in C:xampphtdocsfoobarsrcapp.php on line 18

I've got it set up the same way as the first one, with

namespace Bar;

...

class BarControllerProvider implements ControllerProviderInterface {
    public function coect(Application $app) {
        ...
        $controllers = $app['controllers_factory'];

        $controllers->get('/', function () use ($app) {
           ...
        });

        ...

        retu $controllers;
    }
}

And the autoloader set up in composer:

{
    "require": {
        "silex/silex": "~1.3",
        "doctrine/dbal": "~2.2",
        "symfony/security": "^3.0"
    },
    "autoload" : {
        "psr-0": {
            "Foo": "/src/Foo",
            "Bar": "/src/Bar"
        }
    }
}

File directory looks something like this:

-config (bunch of stuff in here)
-src
  |-Foo
  |  |-FooControllerProvider.php
  |-Bar
  |  |-BarControllerProvider.php
  |-app.php
-vendor (bunch of stuff in here)
-web (bunch of stuff in here)
-composer.json
-composer.lock

app.php has these:

$app->mount("/foos", new FooFooControllerProvider());
$app->mount("/bars", new BarBarControllerProvider());

If I comment out the bars mount, foos will work fine. Why can't it find the BarControllerProvider?

asked 2 mins ago

برچسب: نویسنده: استخدام کار تاريخ: پنجشنبه 2 ارديبهشت 1395 ساعت: 9:48

صفحه بندی