DEV Community

Discussion on: Getting started with Slim PHP framework by building a very simple MVC/OOP app

Collapse
 
bvrulez profile image
bomben

I have the error message "Entry \"Farm\\Controllers\\PenController\" cannot be resolved: Parameter $container of __construct() has no value defined or guessable\nFull definition:\nObject (\n class = Farm\\Controllers\\PenController\n lazy = false\n __construct(\n $container = #UNDEFINED#\n )\n)" and think it might be due to this: "In contrast with Slim 2 and Slim 3, Slim 4 does not ship with a DI container, but instead, supports any PSR-11 compatibly DI container that you provide." (akrabat.com/dependency-injection-i...)

But since I am a total noob it could also be another problem. :)

Collapse
 
bvrulez profile image
bomben

The problem was, that the parameter that gets passed to the constructor is tested for its type by slim. So we have to type-hint it now with "Container". But this is just one of the problems this tutorial raises when applied to Slim 4.