after a lot of search on the forum and google
and the doc of slim v4 impossible to display my templates I would like your light big thank you. (even if the subject has already been mentioned)
The simple answer is that youâre trying to call the render() method on $this->view, but if you notice you havenât defined it in your constructor. You have two choices:
Add a private $view; property at the top of your class and in your constructor add $this->view = $container->get('view'); (working from memory, but I think thatâs right)
Or, in your homePage() method, change $this->view->render() to $this->container->get('view')->render()
Thereâs a bigger piece where we donât recommend that you inject the entire container, preferring to inject the dependencies themselves, but you appear to be using larger controllers, rather than dedicated action classes, so that will be a bit laborious. Also, if youâre using a container that supports auto-wiring (it looks like youâre using PHPDI, which does), you wonât get the best from it this way.