It seems that the $this
is the $app
in this context. And from the earlier part of the documentation you can see that you create the container, add it to the app. So the container is there, injected.
$container = new SlimContainer;
$app = new SlimApp($container);
Although Slim is a microframework - it's not easy. You use Slim 3, no problem with that. If you want to understand better how the things could be structured - I recommend this tutorial (it's for Slim 4).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…