Skip to content

Can't seem to get this working w/ the latest version of Silex. #22

Open
@exts

Description

@exts

Created a generic test class and tried to let PHP-DI do it's thing and it just errors out:

example code:

$container = include __DIR__ . '/container.php';

$app = new DI\Bridge\Silex\Application($container);
$app['debug'] = true;

$app->get('/', [\TMI\Test::class, 'example']);

return $app;

Error:

InvalidArgumentException in ControllerResolver.php line 54:
Controller for URI "/" is not callable: Cannot call example on TMI\Test because it is not a class nor a valid container entry
in ControllerResolver.php line 54
at ControllerResolver->getController(object(Request)) in HttpKernel.php line 136
at HttpKernel->handleRaw(object(Request), '1') in HttpKernel.php line 68
at HttpKernel->handle(object(Request), '1', true) in Application.php line 496
at Application->handle(object(Request)) in Application.php line 477
at Application->run() in index.php line 4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions