Slim 4 php-view

On Slim v3, i’ve using php-view:

$container['view'] = function ($container) {
    $vars = [
        'router' => $container->get('router'),
        'base' => '//example.com',
    ];
    return new PhpRenderer(__DIR__ . '/views', $vars);
};

and for links:

<?= $router->pathFor('page'); ?>

Now with slim v4, how make this work using PHP-DI or league/container?