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. :)
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.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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. :)
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.