You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
Was is configured with Composer? Can you try by embedding it in the whole script just to be sure? Like this:
$container = include __DIR__ . '/container.php';
$app = new DI\Bridge\Silex\Application($container);
$app['debug'] = true;
class Test
{
public function example()
{
return 'example';
}
}
$app->get('/', [Test::class, 'example']);
return $app;
It should work so really I'm shooting in the dark trying to understand ;)
Created a generic test class and tried to let PHP-DI do it's thing and it just errors out:
example code:
Error:
The text was updated successfully, but these errors were encountered: